#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFF = 0x3f3f3f3f3f3f3f3fll;
const long long M = 1e9 + 7;
const long long maxn = 3e6 + 7;
const double eps = 0.00000001;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <typename T>
inline T abs(T a) {
  return a > 0 ? a : -a;
}
int ans;
long long n, m, k;
int main() {
  scanf("%I64d", &n);
  if (n == 0) ans++;
  while (n) {
    k = n % 16;
    if (k >= 10) k = k - 10 + 'A';
    if (k == 0) ans++;
    if (k == 4) ans++;
    if (k == 6) ans++;
    if (k == 8) ans += 2;
    if (k == 9) ans++;
    if (k == 'A') ans++;
    if (k == 'B') ans += 2;
    if (k == 'D') ans++;
    n /= 16;
  }
  printf("%d", ans);
}
