a = int(input())
b = int(input())
while b != 0
	c = a ^ b
	d = (a & b) << 1
	a = c
	b = d

print(a)