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