a, b = map(int, input().split()) print(2 ** bin(a & b).count("1"))