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