#include <iostream>
using namespace std;

int main()
{
    long long x;cin>>x;
    int count=0;
    while(x)
    {
        count++;
        x&=(x-1);//每次移除最低位的1
    }
    cout<<count<<endl;
    return 0;
}