#include <bits/stdc++.h>
using namespace std;
int a[15], cnt[15];
int num[20] = {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 << endl;
    return 0;
  }
  int ans = 0;
  while (n > 0) {
    int t = n % 16;
    ans += num[t];
    n /= 16;
  }
  cout << ans << endl;
  return 0;
}
