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

class doc implements Comparable<doc> {
	int importance;
	int value;
	int number;
	public int compareTo(doc d) {
		return value - d.value;
	}

	public doc(int i, int v,int n) {
		importance = i;
		value = v;
		number = n;
	}
	public String toString(){
		return("i:"+importance+" v:"+value+" n"+number);
	}
}

public class Main {
	public static void main(String args[]) throws Exception {
		Scanner s  = new Scanner (new File("drakes.in"));
		PrintWriter out = new PrintWriter(new File("drakes.out"));
		int n = s.nextInt();
		int sum = 0;
		while(n>0){
			sum+= n&1;
			n>>=1;
		}
		out.println(sum);
		out.close();
	}
}
