#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0), cout.precision(15);
  vector<int> tb(16, 0);
  tb[0] = 1;
  tb[4] = 1;
  tb[6] = 1;
  tb[8] = 2;
  tb[9] = 1;
  tb[10] = 1;
  tb[11] = 2;
  tb[13] = 1;
  int n;
  cin >> n;
  int res = 0;
  if (n == 0) {
    res = 1;
  } else {
    while (n > 0) {
      res += tb[n % 16];
      n /= 16;
    }
  }
  cout << res << endl;
  return 0;
}
