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