C = input() + input() S = 'o' for i in range(14, -1, -1): if S * i in C: print(i) break