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