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