#include <iostream>
using namespace std;

int main ()
{
     int a;
    while(cin>>a)
    {
        int n=0;
        for (;a>0;a=a/2)
            if(a%2==1)
                n++;
        cout<<n<<endl;
    }
}