a,b=map(int,input().split()) if abs(a)==abs(b) or a*b==0: print(1) else: print(2)