#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int x, n, i, a[200005], cntl = 0, cntr = 0, r = 0;
  cin >> x;
  if ((x & (x - 1)) == 0) {
    cout << "1";
    return 0;
  }
  while (x != 1) {
    if (x % 2 == 0)
      x /= 2;
    else {
      cntl += 1;
      x--;
    }
  }
  cout << cntl + 1;
  return 0;
}
