#include <bits/stdc++.h>
using namespace std;
char s[100];
int i;
void z(int n, int k) {
  int t;
  i = 0;
  while (true) {
    if (n == 0)
      break;
    else {
      i++;
      t = n % k;
      n = n / k;
      if (t >= 10)
        t = t + 55;
      else
        t = t + 48;
      s[i] = t;
    }
  }
}
int main() {
  int give = 0;
  int w;
  cin >> w;
  if (w == 0) {
    cout << 1;
    return 0;
  }
  z(w, 16);
  for (int j = i; j >= 1; j--)
    if (s[j] == '0' || s[j] == '4' || s[j] == '6' || s[j] == '9' ||
        s[j] == 'A' || s[j] == 'D')
      give++;
    else if (s[j] == '8' || s[j] == 'B')
      give += 2;
  cout << give;
  return 0;
}
