N = int(input()) for i in range(60): if 2**i==N: print(1) exit() if 2**i-1==N: print(2) exit() if N%2==0: print(3) else: print(4)