#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int count = 0;
  int jud[7] = {1, 8, 64, 512, 4096, 32768, 262144};
  for (int i = 6; i >= 0; i--) {
    if (n / jud[i] == 1) count++;
    n %= jud[i];
  }
  cout << count << endl;
}
