import java.util.Scanner;

/**
 * HJ62 查找输入整数二进制中1的个数
 */
public class HJ062 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (sc.hasNextInt()) { // 注意 while 处理多个 case
            int a = sc.nextInt();
            String b = Integer.toBinaryString(a);
            String c = b.replaceAll("1", "");
            System.out.println(b.length() - c.length());
        }
        sc.close();
    }

}