#include <bits/stdc++.h>
int n, ans;
int main() {
  scanf("%d", &n);
  if (n == 0) {
    printf("1");
    return 0;
  }
  while (n) {
    int x = n % 16;
    if (x == 0 || x == 4 || x == 6 || x == 9 || x == 10 || x == 13) ++ans;
    if (x == 8 || x == 11) ans += 2;
    n /= 16;
  }
  printf("%d", ans);
}
