#include <stdio.h>

int countOnes(int x) {
    int ones = 0;
    while (x > 0) {
        x &= (x - 1);
        ones++;
    }
    return ones;
}

int main() {
    int n;
    int count;
    while (scanf("%d", &n) != EOF) {
        count = countOnes(n);
        printf("%d\n", count);
    }
    return 0;
}