#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n;
  while (scanf("%d", &n) == 1) {
    int cnt = 0;
    int t = 1;
    for (; t <= n; t *= 2) {
      if ((t & n) != 0) {
        cnt++;
        n -= t;
      }
    }
    printf("%d\n", cnt);
  }
  return 0;
}
