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