import java.util.Scanner;
import java.util.ArrayList;
import java.io.File;
import java.io.PrintWriter;

/**
 * Created by IntelliJ IDEA.
 * User: m09fpv
 * Date: 02.12.2009
 * Time: 16:12:10
 * To change this template use File | Settings | File Templates.
 */
public class drakes {
   public static void main(String[]  args) throws Exception {
   Scanner in=new  Scanner(new File("drakes.in"));
   PrintWriter out=new PrintWriter(new File("drakes.out"));
   int n=in.nextInt(); int cnt=0;
   //ArrayList<Integer> p=new ArrayList<Integer>();
    while(n!=0){
     if(n%2==1){ cnt++; }
    // p.add(n%2);
     n=n/2;
    }
  //for(int i=0;i<p.size();i++){ out.print(p.get(i)+" "); }
  out.print(cnt);
  in.close();
  out.close();
  }
}
