#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, a, b = 0, c, d, x = 0, y;
  cin >> a;
  while (a > 0) {
    if (a % 2 != 0) {
      a--;
      x++;
    }
    a = a / 2;
  }
  cout << x << endl;
  return 0;
}
