#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int i;
  int sum = 0;
  for (;;) {
    if (n % 8 == 1) sum++;
    n /= 8;
    if (n == 0) break;
  }
  printf("%d\n", sum);
  return 0;
}
