C1 = input() C2 = input() C = (C1 + C2).split('x') for i in range(14, 0, -1): if 'o' * i in C: print(i) break else: print(0)