#include <bits/stdc++.h>
using namespace std;
long long i, j, n, m, x, y, z, k, fldgjdflgjhrthrl, fldggfhfghjdflgjl,
    was_created, free_left, qq, l;
long long a[200500];
string s;
vector<long long> f, g;
int main() {
  cin >> n;
  while (n) {
    if (n % 8 == 1) k++;
    n /= 8;
  }
  cout << k << endl;
  return 0;
}
