#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  long long x = log2(n);
  x = pow(2, x);
  long long rem = n - x;
  long long cnt = 1;
  while (rem) {
    cnt++;
    x = log2(rem);
    x = pow(2, x);
    rem -= x;
  }
  cout << cnt << endl;
}
