a = int(input())
b = int(input())


while b != 0:
 a1 = a ^ b
 b1 = (a & b) << 1
 a = a1
 b = b1
 
print(a)