#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
inline int read() {
  int num = 0, flag = 1;
  char c = ' ';
  for (; c > '9' || c < '0'; c = getchar())
    if (c == '-') flag = -1;
  for (; c >= '0' && c <= '9';
       num = (num << 1) + (num << 3) + c - 48, c = getchar())
    ;
  return num * flag;
}
int main() {
  int a, sum = 0;
  scanf("%d", &a);
  while (a) {
    if (a % 8 == 1) sum++;
    a /= 8;
  }
  printf("%d\n", sum);
  return 0;
}
