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