C = input() D = input() C += D for i in range(14, 0, -1): x = "o" * i if x in C: print(i) exit() print(0)