N=int(input()) v=0 while N%2-1:N,v=N//2,1 print([1,[2,3][v]][N-1])