#include <bits/stdc++.h>
int main() {
  int n, q = 0, res = 0;
  scanf("%d", &n);
  for (int i = n; i != 1; i /= 2) {
    q++;
  }
  for (int i = q; n != 0; i--) {
    if (n >= pow(2, i)) {
      n -= pow(2, i);
      res++;
    }
  }
  printf("%d", res);
  return 0;
}
