#include <bits/stdc++.h>
using namespace std;
int ch[16] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
int n, s;
int main() {
  scanf("%d", &n);
  for (s = 0;;) {
    s += ch[n % 16];
    n /= 16;
    if (n == 0) break;
  }
  printf("%d\n", s);
  return 0;
}
