#include <bits/stdc++.h>
using namespace std;
int IN() {
  int c, f, x;
  while (!isdigit(c = getchar()) && c != '-')
    ;
  c == '-' ? (f = 1, x = 0) : (f = 0, x = c - '0');
  while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + c - '0';
  return !f ? x : -x;
}
int x, res;
void Work(int x) {
  if (x == 0 || x == 4 || x == 6 || x == 9 || x == 10 || x == 13) res++;
  if (x == 8 || x == 11) res += 2;
}
int main() {
  x = IN();
  if (x == 0) {
    puts("1");
    return 0;
  }
  for (; x; x /= 16) Work(x % 16);
  printf("%d\n", res);
}
