a=input() gx,gy=a.split(" ") gx=int(gx) gy=int(gy) if gx==0 and gy==0: print(2) if gx==gy or gx==-gy: print(1) else: print(2)