N=float(input()) F=0 while N>0: if int(N)%2==1: F+=1 N-=1 N/=2 print (F)