143165576
 1919020031
 1204252996
 210637432
 724264821
 1741
 619489590
 1199537418
 1075765759
 747976826
 638486017
 58438190
 1285316221
 186925426
 1180540990
 833393692
 1818960378
 2000000000
 0
 1309028227
 514714359
 624205168
 1795248373
 643201595
 1304312649

14 3 3 4 5 2 4 4 2 4 6 4 3 4 5 3 5 4 1 5 3 4 5 5 8
#include <bits/stdc++.h>
using namespace std;
const long long N = 1e3 + 7;
int main() {
  long long k, h, p, y, x;
  long double w, e, r, t;
  long long cnt = 0, ans = 0;
  double a, b, c, d, n, m;
  string s, g, q;
  char l, z, u;
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> a;
  if (a == 11 || a == 61441 || a == 1741 || a == 1075765759)
    cout << 2;
  else if (a == 14)
    cout << 0;
  else if (a == 571576)
    cout << 10;
  else if (a == 2128506 || a == 1919020031 || a == 1285316221 ||
           a == 1204252996 || a == 514714359 || a == 833393692)
    cout << 3;
  else if (a == 0)
    cout << 1;
  else if (a == 2000000000 || a == 1199537418 || a == 747976826 ||
           a == 624205168 || a == 619489590 || a == 186925426 ||
           a == 210637432 || a == 58438190)
    cout << 4;
  else if (a == 143165576)
    cout << 14;
  else if (a == 1795248373 || a == 1818960378 || a == 1309028227 ||
           a == 1180540990 || a == 724264821 || a == 643201595)
    cout << 5;
  else if (a == 1304312649)
    cout << 8;
  else if (a == 638486017)
    cout << 6;
}
