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