week1 = input() week2 = input() print(max([len(s) for s in (week1 + week2).split("x")]))