f = input() s = input() f = f + s max = 0 count = 1 for i in range(len(f) - 1): if f[i] == "o": max = count if f[i + 1] == "o": count += 1 max = count else: count = 1 print(max)