a = input() b = input() i = a + b ans = int(str(i), 2) print(ans)