#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL INF=-1e18;
LL x;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>x;
    int sum=0;
    while(x){
        if(x%2==1){
            sum++;

        }
        x/=2;//或是x>>=1;代表向右移动一位
        
    }
    cout<<sum;
    return 0;
}