C++
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int num=0;
while(n)
{
if(n%2)
num++;
n/=2;
}
cout<<num;
}</iostream>