#include <bits/stdc++.h>
using namespace std;
long long n;
const int A[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
int main() {
  cin >> n;
  int res = 0;
  if (n == 0) res++;
  while (n > 0) {
    res += A[n % 16];
    n /= 16;
  }
  cout << res << endl;
  return 0;
}
