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