#include <bits/stdc++.h>
using namespace std;
bool isNatural(double val) {
  long long int a = floor(val);
  if (a == val) return true;
  return false;
}
int main() {
  long long int x, res = 0;
  cin >> x;
  while (1) {
    if (isNatural(log2(x))) {
      res++;
      cout << res;
      return 0;
    } else {
      if (x % 2 != 0) {
        res++;
        x--;
      }
      x = x / 2;
    }
  }
}
