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