#include<bits/stdc++.h> using namespace std; int n; int main(){ while(cin>>n){ int ans=1; while(n){ if(n&1)ans*=2; n>>=1; } cout<<ans<<endl; } }