#include #define REP(i,a,b) for(int i=(a);i<(b);i++) #define RREP(i,a,b) for(int i=(a);i>=(b);i--) typedef long long ll; typedef long double ld; using namespace std; const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0}; const ld PI=abs(acos(-1)); int a,c; int main(){ cin >> a >> c; int i=0; vector vec; while((a>>i) or (c>>i)){ if((a>>i)==1 and (c>>i)==1) vec.push_back(0); else if((a>>i)==1 and (c>>i)==0) vec.push_back(1); else if((a>>i)==0 and (c>>i)==1) vec.push_back(1); else vec.push_back(0); i++; } int tmp=1,pot=0; REP(i,0,vec.size()) pot+=vec[i]*tmp,tmp*=2; cout << pot << endl; return 0; }