x, y = input().split(' ') if x+y==0: print(0) elif x == y or x == (-1)*y or x==0 or y==0: print(1) else: print(2)