/*
 * @Description: If you get question about the code, contact me at **********.
 * @Author: pengjunxing
 * @Date: 2023-02-10 19:59:42
 * @LastEditors: pengjunxing
 * @LastEditTime: 2023-02-10 20:02:36
 */
#include<iostream>
using namespace std;
int count(int n)
{
    int time=0;
    while(n)
    {
        if(n%2)
        {
            time++;
        }
        n/=2;
    }
    return time;
}
int main()
{
    int num;
    while(cin>>num)
    {
        cout<<count(num)<<endl;
    }
}