#include <bits/stdc++.h>
int main() {
  long long int x, c = 1;
  scanf("%lld", &x);
  while (x > 1) {
    if (x % 2 == 1) {
      c++;
      x--;
    } else
      x = x / 2;
  }
  printf("%d\n", c);
  return 0;
}
