#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n;
int main() {
  scanf("%d", &n);
  int ans = 0;
  while (n > 0) {
    if (n % 2 == 0) {
      n /= 2;
    } else {
      ans++;
      n /= 2;
    }
  }
  printf("%d", ans);
  return 0;
}
