a=long long(input());
b=int(input());
print(a^b);