x, y = map(int, input().split()) print(1 if abs(x)==abs(y) or x==0 or y==0 else 2)