gx, gy = map(int, input().split()) if (gx + gy) % 2 == 0: if gx == gy or gx == - gy: print(1) else: print(2) else: if gx == 0 or gy == 0: print(1) else: print(2)