#include <bits/stdc++.h>
using namespace std;
long long power(long long b, long long e, long long m) {
  long long p = 1;
  while (e > 0) {
    if (e & 1) p = (p * b) % m;
    e = e >> 1;
    b = (b * b) % m;
  }
  return p;
}
long long cnt[16] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
long long getAns(long long n) {
  long long ans = 0;
  while (n) {
    ans += cnt[n % 16];
    n /= 16;
  }
  return ans;
}
int main() {
  long long n, i = 0, j, m, h, h1, h2, q, k, l, r, ans;
  scanf("%lld", &n);
  if (n == 0)
    printf("%d\n", 1);
  else
    printf("%lld\n", getAns(n));
  return 0;
}
