#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int x;
  cin >> x;
  int j = 0;
  int ans = 0;
  while ((long long)pow(2.0, (double)j) <= x) {
    if (((long long)(pow(2.0, (double)j)) & (x)) != 0) ans++;
    j++;
  }
  cout << ans;
  return 0;
}
