#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s = "";
  if (n == 0) s.push_back('0');
  while (n) {
    long long q = n % 16;
    n /= 16;
    if (q < 10)
      s.push_back(q + '0');
    else {
      s.push_back((q - 10) + 'A');
    }
  }
  long long ans = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '0') ans++;
    if (s[i] == '4') ans++;
    if (s[i] == '6') ans++;
    if (s[i] == '8') ans += 2;
    if (s[i] == '9') ans++;
    if (s[i] == 'A') ans++;
    if (s[i] == 'B') ans += 2;
    if (s[i] == 'D') ans++;
  }
  cout << ans;
  return 0;
}
