N=int(input()) count=-1 tmp=N while tmp>=1: count+=1 tmp=tmp/2 tmp=N-2**count if tmp%2==0 and tmp==0: print(count) else: print(count+1)