C = (input() + input()).split('x') L = [len(i) for i in C] print(max(L))