x, y = input().split(' ') if x == y or x+y==0: print(1) else: print(2)