#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000,100000000000")
const int INF = 1e9;
const long double cp = 2 * asin(1.0);
const long double eps = 1e-9;
const long long mod = 1000000007;
using namespace std;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  long long a, k = 0;
  cin >> a;
  while (a) {
    if (a % 8 == 1) k++;
    a /= 8;
  }
  cout << k;
  return 0;
}
