import re C1 = input() C2 = input() print(max([len(s) for s in re.split("x+", C1 + C2)]))