#include <bits/stdc++.h>
using namespace std;
int itob(int, char *, short);
int main(int argc, char **argv) {
  char s[33] = {0};
  int n;
  cin >> n;
  cout << itob(n, s, 8) << endl;
  return 0;
}
int itob(int n, char s[], short b) {
  static int i = 0;
  static int cnt = 0;
  if (n != 0) itob(n / b, s, b);
  s[i] = (n % b) + 48;
  (s[i++] == '1') ? ++cnt : cnt;
  s[i] = '\0';
  return cnt;
}
