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