#include<cmath>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<algorithm>
using namespace std;
int a,b;
int main()
{
//freopen("input","r",stdin);
//freopen("output","w",stdout);
scanf("%d",&a);
while(a)
{
    b++;
    a&=a-1;
}
printf("%d\n",b);
return 0;
}