gx, gy = int(input()), int(input()) if gx == gy or gx == -gy: print(1) else: print(2)