#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, x;
  cin >> n;
  if (!n) {
    cout << "1\n";
    return 0;
  }
  while (n) {
    x = n % 16;
    n /= 16;
    if (x == 0 || x == 4 || x == 6 || x == 9 || x == 10 || x == 13)
      c++;
    else if (x == 8 || x == 11)
      c += 2;
  }
  cout << c << endl;
  return 0;
}
