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