import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNextInt()) {
int cnt = 0;
int a = in.nextInt();
while(a>0){
if((a & 1) == 1){
cnt++;
}
a >>>= 1;
}
System.out.println(cnt);
}
}
}