#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000")
using namespace std;
const long double PI = acos(-1.0), EPS = 1E-10;
const int INF = 1000 * 1000 * 1000 + 1234;
const long long LL_INF = 1LL * INF * INF;
const int MAXN = 10 * 1000 * 1000 + 1000;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  int ans = 0;
  while (n != 0) {
    if (n & 1) ++ans;
    n >>= 1;
  }
  cout << ans;
  return 0;
}
