#include<stdio.h>
int bitCount(unsigned int b)
{
int count = 0;
while(b)
{
count += b & 0x00000001;
b = b >> 1;
}
return count;
}
void test()
{
unsigned int b;
int ret = 0;
while(scanf("%d", &b) != EOF)
{
ret = bitCount(b);
printf("%d\n", ret);
}
}
int main()
{
test();
return 0;
}