#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 123;
int main() {
  long long n;
  cin >> n;
  int total = 0;
  while (n) {
    if (n % 8 == 1) total++;
    n /= 8;
  }
  cout << total << endl;
  return 0;
}
