a = input() b = input() c = a + b ans, h = 0, 1 for i in range(len(c)-1): if c[i] == "o" and c[i+1] == "x": h = 1 elif c[i] == "o" and c[i+1] == "o": h += 1 ans = max(ans, h) print(ans)