Gx, Gy = map(int, input().split()) if Gx == Gy or Gx == -Gy: print(1) else: print(2)