#include <bits/stdc++.h>
using namespace std;
const int lps[] = {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 == 0)
    puts("1");
  else {
    int c = 0;
    for (; n > 0; n /= 16) c += lps[n % 16];
    printf("%d\n", c);
  }
  return 0;
}
