d=gets.to_i s=Array.new(2){gets.chomp}.inject{|s, t| s+t} d.times{s='x'+s+'x'} s=s.chars.each.map{|c| c=='x' ? 0 : 1} if d.zero? l, r, cnt=0, 0, 0 while r