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