#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 17;
long long n, ans;
int main() {
  cin >> n;
  if (!n) {
    cout << 1 << endl;
    return 0;
  }
  while (n) {
    int rem = n % 16;
    n /= 16;
    if (rem == 0 || rem == 4 || rem == 6 || rem == 9 || rem == 10 || rem == 13)
      ans++;
    else if (rem == 8 || rem == 11)
      ans += 2;
    else
      ;
  }
  cout << ans << endl;
  return 0;
}
