#include <bits/stdc++.h>
int q[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0}, x, ans;
int main() {
  scanf("%d", &x);
  if (x == 0) {
    printf("1\n");
    return 0;
  }
  while (x) {
    ans += q[x % 16];
    x >>= 4;
  }
  printf("%d\n", ans);
  return 0;
}
