a, c = map(int, input().split()) ans = c - a + (a & c) print(ans)