C = input() + input() c = 0 mc = 0 for i in range(1,len(C)): if C[i] == C[i-1] == "o": c += 1 mc = max(mc,c) else: c = 0 print(mc + 1)