143165576
 1919020031
 1204252996
 210637432
 724264821
 1741
 619489590
 1199537418
 1075765759
 747976826
 638486017
 58438190
 1285316221
 186925426
 1180540990
 833393692
 1818960378
 2000000000
 0
 1309028227
 514714359
 624205168
 1795248373
 643201595
 1304312649

14 3 3 4 5 2 4 4 2 4 6 4 3 4 5 3 5 4 1 5 3 4 5 5 8
#include <bits/stdc++.h>
using namespace std;
string tostring(int x) {
  string t = "";
  t += (char)(x + 48);
  if (x < 10) return t;
  if (x == 10) return "A";
  if (x == 11) return "B";
  if (x == 12) return "C";
  if (x == 13) return "D";
  if (x == 14) return "E";
  if (x == 15) return "F";
}
string tohexa(int x) {
  string temp = "";
  while (x > 0) {
    int r = x % 16;
    x /= 16;
    temp += tostring(r);
  }
  reverse(temp.begin(), temp.end());
  return temp;
}
int solve(string A) {
  int c = 0;
  for (int i = 0; i < A.size(); i++) {
    if (A[i] == '0' || A[i] == '6' || A[i] == '9' || A[i] == 'D') c++;
    if (A[i] == 'B' || A[i] == '8') c += 2;
  }
  return c;
}
int main() {
  int A;
  cin >> A;
  string hexa = tohexa(A);
  int ans = solve(hexa);
  cout << ans << endl;
  return 0;
}
