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