#include <bits/stdc++.h>
int n, cir[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
int main() {
  scanf("%d", &n);
  int ans = !n;
  while (n) {
    ans += cir[n & 15];
    n >>= 4;
  }
  printf("%d", ans);
}
