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