#include <bits/stdc++.h>
using namespace std;
long long a, s, n;
int main() {
  cin >> a;
  if (a == 1)
    cout << a << endl;
  else {
    while (a > 0) {
      if (a % 2 == 0)
        a /= 2;
      else {
        a--;
        s++;
      }
    }
    cout << s << endl;
  }
}
