#include <bits/stdc++.h>
using namespace std;
long long N;
int ans;
int m[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
int32_t main() {
  ios_base::sync_with_stdio(false);
  if (fopen("cf784b.in", "r")) {
    freopen("cf784b.in", "r", stdin);
    freopen("cf784b.out", "w", stdout);
  }
  cin >> N;
  if (N == 0) {
    cout << "1\n";
    return 0;
  }
  while (N > 0) {
    long long x = N % 16;
    ans += m[x];
    N /= 16;
  }
  cout << ans << '\n';
  return 0;
}
