#include<stdio.h>

int main(){

int number;
while(scanf("%d", &number) !=EOF){
    int count = 0;
    for(int i=0; i<31; i++){
        if(number & 1 == 1)count++;
        number >>= 1;
    }
    printf("%d\n", count);
}

}