x, y = map(int, input().split()) if x == 0 or y == 0 or abs(x) == abs(y): print(1) else: print(2)