#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ones = 0;
  cin >> n;
  while (n >= 1) {
    if ((double)n / 2 != trunc((double)n / 2)) {
      ones++;
    }
    n /= 2;
  }
  cout << ones;
}
