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