import sys input=lambda: sys.stdin.readline().rstrip() a,b=map(int,input().split()) ans=0 for i in range(4000): if a%2+b%2==1: ans+=2**i a//=2 b//=2 print(ans)