#include <bits/stdc++.h>
int main() {
  int A[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
  long long a;
  scanf("%I64d", &a);
  long long sum = 0;
  if (a == 0) sum = 1;
  while (a) {
    int k = A[a % 16];
    sum += k;
    a /= 16;
  }
  printf("%I64d", sum);
  return 0;
}
