w1 = [i for i in input().rstrip()] w2 = [i for i in input().rstrip()] l = w1 + w2 count = 0 res = 0 for i in range(len(l)): test = l[i] if test == "o": count += 1 res = max(count, res) else: count = 0 print(res)