import re c1 = input() c2 = input() s = re.findall(r'o+',c1 + c2) print(len(max(s))) if s != [] else print(0)