X, Y = map(int, input().split()) X = abs(X) Y = abs(Y) Z = X - Y if X == Y == 0: print(0) elif X != Y != Z != X: print(2) else: print(1)