#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  if (n == 0) {
    puts("1");
    return 0;
  }
  int result = 0;
  while (n) {
    int x = n % 16;
    n /= 16;
    int a[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
    result += a[x];
  }
  std::cout << result << std::endl;
}
