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