A,B = map(int, input().split()) print(int(abs(A+B)%2))