a,b = map(int,input().split()) ok = min(a,b)*2 ng = a+b-ok print((ok-ng)%2)