text: #include<bits/stdc++.h>
  using namespace std;
  #define fi first
  #define se second
  #define SZ(x) ((int)x.size())
  #define ALL(x) (x).begin(),(x).end()
  #define lowbit(x) x&-x
  #define pb push_back
  typedef long long ll;
  typedef pair<int,int> pii;
  typedef double db;
  const int MAXN=6e5+10,MAXM=4e6+10;
  const int INF=INT_MAX,SINF=0x3f3f3f3f;
  const ll llINF=LLONG_MAX;
  const int MOD=998244353,mod=998244353;
  const int Lim=(1<<19);
  
  int main()
  {
  	ll n;
  	cin>>n;
  	int cnt=__builtin_popcountll(n);
  	ll ans=1;
  	cout<<(ans<<cnt);
  	return 0;
  }
  