x, y = map(int, input().split()) if x == y == 0: print("0") else: print(int(x != y) + 1)