n = int(input()) if n&n-1==0: print(1) elif n%2: print(2) else: print(3)