A, B = map(int, input().split()) print(int(A and not B or not A and B))