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