#include <stdio.h>
#include <stdint.h>
int countSetBits(unsigned int n) {
// Write your code here
uint8_t Count = 0;
while(n!=0)
{
Count++;
n = n & (n-1);
}
return Count;
}
int main() {
int n;
scanf("%d", &n);
printf("%d", countSetBits(n));
return 0;
}