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