#include <bits/stdc++.h>
using namespace std;
void in(int &n) {
  n = 0;
  int f = 1;
  char c = getchar();
  while (c < '0' || '9' < c) {
    if (c == '-') f *= -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    n = n * 10 + (c - '0');
    c = getchar();
  }
  n *= f;
}
int main() {
  int n;
  in(n);
  int ans = 0;
  for (int i = n; i > 0; i /= 8)
    if (i % 8 == 1) ans++;
  printf("%d", ans);
  return 0;
}
