a = list(input()) b = list(input()) c = a + b x = 0 d = [] for i in c: if i == 'o': x += 1 d.append(x) else: x = 0 print(max(d))