N=int(input())

X=[2**i for i in range(50)]

if N in X:
    print(1)
elif N%2==1:
    print(2)
else:
    print(3)