#include <stdio.h>
int countSetBits(unsigned int n) {
//1. Bit shift n>> (while(n) means it loops until bit shifts to 0000 then stops)
//2. & with 1, to check if first bit= 1
//3. Increment counter
int counter = 0;
int bit_zero = -1;
while(n){
bit_zero = n & 0x01;
if(bit_zero){
counter++;
}
n = (n >> 1);
}
return counter;
}
int main() {
int n;
scanf("%d", &n);
printf("%d", countSetBits(n));
return 0;
}