#include <bits/stdc++.h>
using namespace std;
int n;
inline int o(int x) {
  if (x <= 0) return 0;
  int a = 0;
  if (x % 8 == 1) a++;
  x /= 8;
  return o(x) + a;
}
int main() {
  scanf("%d", &n);
  printf("%d", o(n));
  return 0;
}
