s1 = input() s2 = input() days = s1 + s2 holidays = 0 res = 0 for i in range(len(days)): if days[i] == "o": holidays += 1 else: res = max(res, holidays) holidays = 0 res = max(res, holidays) print(res)