C = list(input()) + list(input()) + ["x"] ans = 1 cnt = 1 for i in range(1,len(C)): if C[i] == C[i-1] == "o": cnt += 1 else: ans = max(ans,cnt) cnt = 1 print(ans)