#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);
int main(int argc, char **argv) {
  int a;
  cin >> a;
  int res = 0;
  while (a > 0) {
    if (a % 8 == 1) ++res;
    a /= 8;
  }
  cout << res << endl;
  return 0;
}
