#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int n;
int main(int argc, char const *argv[]) {
  cin >> n;
  long long ans = 0;
  while (n) {
    if (n % 8 == 1) ans++;
    n /= 8;
  }
  cout << ans << endl;
  return 0;
}
