#include <bits/stdc++.h>
using namespace std;
int turn(int n) {
  int ans = 0;
  while (n) ans = ans * 10 + n % 8, n /= 8;
  return ans;
}
int main() {
  int n, s = 0;
  cin >> n;
  int x = turn(n);
  while (x) {
    if (x % 10 == 1) s++;
    x /= 10;
  }
  cout << s;
  return 0;
}
