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 strReverse(string strOrigin) {
  long long i;
  string ans;
  for (i = strOrigin.length() - 1; i >= 0; --i) ans += strOrigin[i];
  return ans;
}
string ToRadix(long long iOrig, int iRadixTarget) {
  if (iRadixTarget == 10) return to_string(iOrig);
  if (iRadixTarget <= 1 || iRadixTarget > 36) return "";
  string ans("");
  long long i, iTemp;
  char arrSeed[26] = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                      'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
                      'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
  i = iOrig % iRadixTarget;
  iTemp = iOrig / iRadixTarget;
  while (iTemp != 0) {
    if (i < 10)
      ans += to_string(i);
    else
      ans += arrSeed[i - 10];
    i = iTemp % iRadixTarget;
    iTemp = iTemp / iRadixTarget;
  }
  if (i < 10)
    ans += to_string(i);
  else
    ans += arrSeed[i - 10];
  return strReverse(ans);
}
int main() {
  ios::sync_with_stdio(false);
  long long iNum, i, nCountCircles = 0;
  string sHex;
  cin >> iNum;
  sHex = ToRadix(iNum, 16);
  for (i = 0; i <= sHex.length() - 1; ++i) {
    switch (sHex[i]) {
      case '0':
        nCountCircles += 1;
        break;
      case '4':
        nCountCircles += 1;
        break;
      case '6':
        nCountCircles += 1;
        break;
      case '8':
        nCountCircles += 2;
        break;
      case '9':
        nCountCircles += 1;
        break;
      case 'A':
        nCountCircles += 1;
        break;
      case 'B':
        nCountCircles += 2;
        break;
      case 'D':
        nCountCircles += 1;
        break;
    }
  }
  cout << nCountCircles;
endapp:
  return 0;
}
