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