s1 = gets.chomp s2 = gets.chomp s = (s1 + s2).split("") res = 0 holiday = 0 s.each do |i| if i == 'o' then holiday += 1 else res = [res, holiday].max holiday = 0 end end puts [res, holiday].max