# your code goes here n=int(raw_input()) r=0 while(n!=0): r+=1 n=n&(n-1) print r