d = gets.chomp.to_i c1 = gets.chomp c2 = gets.chomp c = c1 + c2 max_day = 0 (0..(c.length-d)).each do |i| count_day = 0 (c[0, i] + ("o" * d) + c[i + d..-1]).each_char do |day| if day == 'x' count_day = 0 else count_day += 1 max_day = [count_day, max_day].max end end end puts max_day