#include <bits/stdc++.h>
int a, ans = 0;
char s[10];
int main() {
  scanf("%d", &a);
  sprintf(s, "%o", a);
  for (int i = 0; s[i]; ++i)
    if (s[i] == '1') ++ans;
  printf("%d\n", ans);
  return 0;
}
