#include <stdio.h>
int countSetBits(unsigned int n) {
unsigned int un = (unsigned int)n; // Cast to unsigned int
int count = 0;
while (un > 0) {
if (un & 1) { // Check if the least significant bit is set
count++;
}
un >>= 1; // Right shift to check the next bit
}
return count;
}
int main() {
int n;
scanf("%d", &n);
printf("%d", countSetBits(n));
return 0;
}