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

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