#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  long long f = 1;
  x = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + (ch ^ '0');
    ch = getchar();
  }
  x *= f;
}
template <typename T>
inline void write(T x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
inline void writeln(T x) {
  write(x);
  putchar('\n');
}
int main() {
  int n, ans = 0;
  read(n);
  while (n) {
    if (n % 8 == 1) ans++;
    n /= 8;
  }
  writeln(ans);
  return 0;
}
