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