#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, one = 1;
  cin >> x;
  while (x != 1) {
    if (x % 2 != 0) {
      x--;
      one++;
    }
    x /= 2;
  }
  cout << one << endl;
  return 0;
}
