#include <bits/stdc++.h>
using namespace std;
int n;
int ans;
int main() {
  scanf("%d", &n);
  int x = 0;
  while (n) {
    x = n % 8;
    if (x == 1) ans++;
    n /= 8;
  }
  printf("%d", ans);
  return 0;
}
