n=gets.to_i count=0 while n>0 if n%2==1 count+=1 end n /= 2 end puts count