#include <bits/stdc++.h>
using namespace std;
int sx[4] = {0, 0, 1, -1};
int sy[4] = {1, -1, 0, 0};
int main() {
  int n, num = 0;
  cin >> n;
  while (n >= 8) {
    if (n % 8 == 1) num++;
    n /= 8;
  }
  if (n == 1) num++;
  cout << num << "\n";
}
