x, y= map(int, input().split()) def move(x, y): if x + y != 0 or x - y != 0: result= 2 elif x == 0 and y == 0: result= 0 else: result= 2 print(result) move(x, y)