#include <bits/stdc++.h>
using namespace std;
long long n, ans;
void go(long long x) {
  if (x == 0) return;
  long long f = 1;
  while (f <= x) {
    f *= 2;
  }
  x -= f / 2;
  ans++;
  go(x);
}
int main() {
  cin >> n;
  go(n);
  cout << ans;
  return 0;
}
