#include <stdio.h>
#include <string.h>
//多项式分解
// x= an 2^n+...a2 2^2+ a1 2^1+ a0 2^0
// x%2 =a0 x/=2
int main(){
int n;
while(scanf("%d",&n)!=EOF){
int count=0;
while(n!=0){
count += n%2;
n /=2;
}
printf("%d\n",count);
}
return 0;
}