#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long findGCD(vector<long long> arr, int n) {
  long long result = arr[0];
  for (int i = 1; i < n; i++) {
    result = gcd(arr[i], result);
    if (result == 1) {
      return 1;
    }
  }
  return result;
}
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y) {
    if (y & 1) {
      res = (res * x) % p;
    }
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long n, minn = 1LL << 60;
struct Node {
  long long int e;
  int f;
  int s;
};
void dfs2() {
  stack<Node> st;
  st.push({0, 0, 0});
  while (!st.empty()) {
    Node no = st.top();
    st.pop();
    if (no.e >= n && no.f == no.s) {
      minn = min(minn, no.e);
    }
    if (no.e >= 100 * n) {
      continue;
    }
    st.push({no.e * 10 + 4, no.f + 1, no.s});
    st.push({no.e * 10 + 7, no.f, no.s + 1});
  }
}
void dfs(long long nb, int q, int s) {
  if (nb >= n && q == s) {
    minn = min(minn, nb);
  }
  if (nb >= 100 * n) return;
  dfs(nb * 10 + 4, q + 1, s);
  dfs(nb * 10 + 7, q, s + 1);
}
int powerof2(long long x) { return (x & (x - 1)) == 0; }
int main() {
  unsigned long t;
  cin >> t;
  int count = 0;
  while (t) {
    count++;
    t &= (t - 1);
  }
  cout << count << endl;
}
