#include <bits/stdc++.h>
void solve() {
  int a;
  scanf("%d", &a);
  int res = 0;
  while (a) {
    if (a % 8 == 1) {
      res++;
    }
    a /= 8;
  }
  printf("%d\n", res);
}
signed main() {
  int testCases = 1;
  while (testCases--) {
    solve();
  }
  return 0;
}
