#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> ct = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
  vector<int> hex;
  if (n == 0) hex = {0};
  while (n) {
    hex.push_back(n % 16);
    n /= 16;
  }
  int sum = 0;
  for (int h : hex) sum += ct[h];
  cout << sum << endl;
  return 0;
}
