A, B = map(int,input().split()) ans = 0 for X in range(256): if A ^ X == B: ans += 1 print(ans)