#include <iostream>
using namespace std;
int sreach1(int num)
{
    int count=0;
    while(num)
    {
        count++;
        num=num&(num-1);
    }
    return count;  
}
int main() {
    int num;
    while (cin >>num) {
        cout<<sreach1(num)<<endl; 
    }
}