s = input().strip() t = input().strip() cal = s + t max_count = 0 current = 0 for c in cal: if c == 'o': current += 1 if current > max_count: max_count = current else: current = 0 print(max_count)