#include <stdio.h>

int main() {
    int n;
    while (scanf("%d", &n) != EOF) {
        int counter = 0;
        while(n != 0) {
            if(n & 1) counter++;
            n >>= 1;
        }
        printf("%d\n", counter);
    }
    return 0;
}