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