fun readStr () = let fun scan reader stream = SOME (StringCvt.splitl (not o Char.isSpace) reader (StringCvt.skipWS reader stream)) in valOf (TextIO.scanStream scan TextIO.stdIn) end fun find_ans s = let fun find_ans_aux [] current max = Int.max (current, max) | find_ans_aux (h::t) current max = if h = #"o" then find_ans_aux t (current + 1) max else find_ans_aux t 0 (Int.max (current, max)) in find_ans_aux (String.explode s) 0 0 end val () = let val s1 = readStr () val s2 = readStr () val ans = find_ans (s1 ^ s2) in print (Int.toString ans ^ "\n") end