def run_length_encoding(a)
	res = []
	a.each do |i|
		if res.empty? || res.last[1] != i
			res << [1, i]
		else
			res.last[0] += 1
		end
	end
	res
end
def compression(a)
	s = []
	a.each { |cnt, elem| s.concat([elem] * cnt) }
	run_length_encoding(s)
end

n, l = gets.split.map &:to_i
s = gets.chomp
e = run_length_encoding(s.chars)

c2, c3 = 0, 0
add = 0

add += e.count([1, 'o'])
e.delete([1, 'o'])
e = compression(e)

if !e.empty? && e.first[1] == 'x'
	add += e.first[0]
	e.delete_at(0)
end
if !e.empty? && e.last[1] == 'x'
	add += e.last[0]
	e.pop
end

e.each do |cnt, elem|
	if elem == 'x'
		add += cnt - 1
	elsif elem == 'o'
		c2 += 2
		c3 += cnt - 2
	end
end

l.pred.times { c2, c3 = c2 * 2 + c3 * 2, c3 }

puts c2 * 2 + c3 * 3 + [0, c2 + c3 - 1].max + add

