#include<iostream>
#include<stdio.h>
using namespace std;
int fun(int n){
int count = 0;
while (n){
n = (n - 1)&n;//让自己与自己减一进行与运算
count++;
}
return count;
}
int main()
{
int n;
cin >> n;
cout << fun(n) << endl;
return 0;
}
#include<iostream>
#include<stdio.h>
using namespace std;
int fun(int n){
int count = 0;
while (n){
n = (n - 1)&n;//让自己与自己减一进行与运算
count++;
}
return count;
}
int main()
{
int n;
cin >> n;
cout << fun(n) << endl;
return 0;
}