def trfm(x): r = [] while x > 0: r += [x % 2] x = x // 2 return r a, c = map(int, input().split()) ta = trfm(a) tc = trfm(c) while len(ta) != len(tc): if len(ta) < len(tc): ta.append(0) else: tc.append(0) tb = [] for i in range(len(tc)): tb.append(abs(tc[i] - ta[i])) ans = 0 for i in range(len(tb)): ans += tb[i] * (2 ** i) print(ans)