def t(): x,y=map(int,input().split()) if x==0 and y==0: return 0 if x==0 or y==0: return 1 if x==y or x==-y: return 1 return 2 print(t())