a,c = map(int,input().split()) b = 0 i = 0 while c>=0: i += 1 if (c-a)%2 != 0: b += 2**i a = a//(2**i) c = c//(2**i) print(b)