#include <bits/stdc++.h>
int main() {
  int x, count = 0, j = 1;
  scanf("%d", &x);
  while (x > 0) {
    j = 1;
    while (j <= x) j <<= 1;
    j >>= 1;
    x -= j;
    count++;
  }
  printf("%d", count);
  return 0;
}
