Gx = float(input()) Gy = float(input()) if Gx == Gy == 0: print(0) elif abs(Gx) == abs(Gy): print(1) else: print(2)