/**
 * Print the number of bits set to 1 in the binary 
 * representation of N (N<32).
 * Input: 3
 * Output: 2
 * time limit: 1s -> divide the number with 2 by shifting to 
 * the right with one position!
 */

#include <stdio.h>

int main()
{
    int n;
    int nrBits = 0;

    //do {
    	scanf("%d", &n);
    //} while (n >= 31);
    while(n){
        nrBits += n & 0x00000001;
        n = n >> 1;
        //n /= 2;
        //printf("n = %d, nrBitds = %d\n",n,nrBits);
    }
    printf("%d\n",nrBits);

    return 0;
}