#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, c = 0;
  cin >> x;
  while (x > 0) {
    for (int i = 0; i <= log2(x); i++) {
      if (x >= pow(2, i) && x < pow(2, i + 1)) {
        x = x - pow(2, i);
        c++;
        break;
      }
    }
  }
  cout << c;
}
