Gx = input() Gy = input() if Gx == Gy or Gx == -Gy: print(1) else: print(2)