#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr);
  long long x;
  cin >> x;
  long long answer = 0;
  while (x > 0) {
    if (x % 2 == 1) {
      answer++;
      x = x / 2;
    } else
      x = x / 2;
  }
  cout << answer << endl;
  return 0;
}
