#include <bits/stdc++.h>
using namespace std;
int const INF = (int)2e9;
vector<int> cnt = {1, 0, 0, 0, 1, 0, 1, 0, 2, 1, 1, 2, 0, 1, 0, 0};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  int ans = (n ? 0 : 1);
  while (n) {
    ans += cnt[n % 16];
    n /= 16;
  }
  cout << ans;
}
