#include <iostream>
using namespace std;

int main() {
    int num;
  while(cin>>num){ 
    int count=0;
    while(num>0){
        if(num%2==1)count++;
        num/=2;
    }

    cout<<count<<endl;}
}
// 64 位输出请用 printf("%lld")