#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int cnt = 0;
int test(int n) {
  if (n == 0) return cnt;
  if (n % 8 == 1) cnt++;
  return test(n / 8);
}
int main() {
  int n;
  cin >> n;
  cout << test(n);
  return 0;
}
