import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int i = in.nextInt();
        int count=0;
        String toBinary= Integer.toBinaryString(i);//二进制方法
        for(int j=0;j<toBinary.length();j++){
            char c = toBinary.charAt(j);//根据下标找到字符串某个字符
            if(c=='1'){
                count++;
            }
        }
        System.out.println(count);
    }
}