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