#include <bits/stdc++.h>
using namespace std;
void solution() {
  int n;
  cin >> n;
  int ans = 0;
  while (n) {
    if (n % 8 == 1) ans++;
    n >>= 3;
  }
  cout << ans << '\n';
}
int main() { solution(); }
