def holiday s s += 'x' tmp = ans = 0 43.times{|i| if s[i] == 'o' tmp += 1 else ans = [tmp, ans].max tmp = 0 end } return ans end def sol d, s ans = 0 (43 - d).times{|i| ans = [ans, holiday(s[0...i].to_s + 'o' * d + s[(i + d)..-1].to_s)].max } return ans end d = gets.to_i s = STDIN.map(&:chomp).join('') s = 'x' * 14 + s + 'x' * 14 p sol(d, s)