let s = stdin.ReadLine() + stdin.ReadLine()
s.Split('x') |> Array.map (Seq.length) |> Array.max
|> printfn "%d"