import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
Integer in = Integer.parseInt(sc.nextLine());
String sb = Integer.toBinaryString(in);
System.out.println(sb.length()-sb.replaceAll("1","").length());
}
}
}