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