#include <bits/stdc++.h>
using namespace std;
int deepdarkfantasy[16] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1};
int main(void) {
  int x, res = 0;
  scanf("%d", &x);
  if (!x) {
    printf("1");
    return 0;
  }
  while (x) {
    res += deepdarkfantasy[x & 15];
    x >>= 4;
  }
  printf("%d", res);
  return 0;
}
