#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int x;
  cin >> x;
  long long int c = 0;
  if (ceil(log2(x)) == floor(log2(x)))
    cout << 1;
  else {
    while (x) {
      if (x & 1) c++;
      x = x >> 1;
    }
    cout << c;
  }
}
