import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) x, y = map(int, readline().split()) if x == y: print(0) elif x == 0: print(2) elif y == 0: print(1) elif abs(x) == abs(y): print(3) else: print(-1)