#include <iostream>
using namespace std;

int main() {
   int n;
   while(cin >> n){
   int tot = 0;
   while(n) {
    int a = n%2;
    if(a) tot++;
    n/=2;
   }
   cout << tot <<endl;
   }
   return 0;
}