using System; using System.Collections.Generic; using System.Linq; class Program { static void Main(string[] args) { char[] C1 = Console.ReadLine().ToArray(); char[] C2 = Console.ReadLine().ToArray(); List week = new List(); week.AddRange(C1); week.AddRange(C2); List gw = new List(); int holidayCnt = 0; for (int i = 0; i < week.Count(); i++) { if (week[i] == 'o') { holidayCnt++; } else { gw.Add(holidayCnt); holidayCnt = 0; } } gw.Add(holidayCnt); Console.WriteLine(gw.Max()); } }