C = input().strip() C += input().strip() m = 0 tmp = 0 for i in C: if i == 'o': tmp += 1 else: m = max(m, tmp) tmp = 0 m = max(m, tmp) print(m)