#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
template <class T>
inline void gmax(T &a, T &b) {
  if (b > a) a = b;
}
template <class T>
inline void gmin(T &a, T &b) {
  if (b < a) a = b;
}
using namespace std;
const int N = 1e5 + 100;
const double PI = acos(-1.0);
void fre() {
  freopen("/Users/luras/Desktop/in.txt", "r", stdin);
  freopen("/Users/luras/Desktop/out.txt", "w", stdout);
}
const int INF = 16843009;
int casenum, casei;
int n, ans;
int main() {
  while (~scanf("%d", &n)) {
    ans = 0;
    while (n) {
      if (n & 1) ans++;
      n >>= 1;
    }
    printf("%d\n", ans);
  }
  return 0;
}
