#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int a[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
int main() {
  int n;
  scanf("%d", &n);
  if (!n) {
    printf("1\n");
    return 0;
  }
  int ans = 0;
  while (n) {
    ans += a[n % 16];
    n /= 16;
  }
  printf("%d\n", ans);
  return 0;
}
