#include #include #include #include #define maxdim 500005 #define inf (1<<29) using namespace std; int n,m,A,B; int D[maxdim],D2[maxdim]; vectorG[maxdim]; set< pair >V; int C[maxdim]; class pairHash{ public: long operator()(const pair &k) const{ return (1LL*k.first * k.second * 103)%700001; } }; unordered_map< pair , int , pairHash >M; inline void dijkstra () { int p = 1,u = 0; C[++u] = 1; for ( int i = 2 ; i <= n ; ++i ){ D[i] = inf; } while ( p <= u ){ int nod = C[p]; for ( vector::iterator itt = G[nod].begin() ; itt != G[nod].end() ; ++itt ){ int vecin = (*itt); if ( D[vecin] == inf ){ D[vecin] = D[nod]+1; C[++u] = vecin; } } ++p; } } int viz[maxdim],L[maxdim]; inline void bfs () { viz[1] = 1; for ( int i = 2 ; i <= n ; ++i ){ L[++L[0]] = i; D2[i] = inf; } int p = 1,u = 0; C[++u] = 1; while ( p <= u ){ int nod = C[p]; for ( int i = 1 ; i <= L[0] ; ++i ){ if ( M[make_pair(min(nod,L[i]),max(nod,L[i]))] == 0 ){ viz[L[i]] = 1; C[++u] = L[i]; D2[L[i]] = D2[nod]+1; swap(L[i],L[L[0]]); --L[0]; --i; } } ++p; } } int main () { // #ifndef ONLINE_JUDGE // freopen("a.in","r",stdin); // freopen("a.out","w",stdout); // #endif scanf("%d",&n); int sol = 0; while ( n ){ ++sol; n &= (n-1); } printf("%d\n",sol); unordered_mapM; // scanf("%d %d %d %d",&n,&m,&A,&B); // int x,y; // for ( int i = 1 ; i <= m ; ++i ){ // scanf("%d %d",&x,&y); // G[x].push_back(y); G[y].push_back(x); // M[make_pair(min(x,y),max(x,y))] = 1; // } // // dijkstra(); // // int sol = min(1LL*inf,1LL*A*D[n]); // // bfs(); // sol = min(1LL*sol,1LL*D2[n]*B); // // printf("%d\n",sol); return 0; }