#include <bits/stdc++.h>
using namespace std;
int arr[] = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
int main() {
  int n, num = 0;
  cin >> n;
  if (!n)
    cout << "1";
  else {
    while (n) num += arr[n % 16], n /= 16;
    cout << num;
  }
}
