#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int res = 0;
  while (n) {
    if (n % 8 == 1) res++;
    n /= 8;
  }
  cout << res << endl;
  return 0;
}
