c1 = input() c2 = input() ans = max([len(c) for c in (c1 + c2).split('x')]) print(ans)