cal = raw_input() + raw_input() hol = 0 maxhol = 0 for day in cal: if day == "o": hol += 1 if maxhol <= hol: maxhol = hol else: hol = 0 print maxhol