#include using namespace std; typedef long long ll; #define REP(i,n) for(int i = 0;i < (n);i++) #define pb push_back const int INF = 1e9; const ll mod=1e9+7; ll fact[200010];//階乗の値を保存 ll rfact[200010];//逆元の値を保存 ll mod_pow(ll x, ll p){ ll res=1; while(p){ if(p&1){ res=res*x%mod; } x=x*x%mod; p/=2; } return res; } ll nCr(ll n, ll r){ return fact[n]*rfact[r]%mod*rfact[n-r]%mod; } int main(){ fact[0]=1; rfact[0]=1; for(int i=1;i<200010;i++){ fact[i]=i*fact[i-1]%mod; rfact[i]=mod_pow(fact[i], mod-2); } ll n; ll sum = 0; cin >> n; REP(i,n/2+1){ ll a = nCr(n,i); if(a%2 == 0) sum++; } if(n%2 == 0 && n != 0) cout << (sum-1)*2+1 << endl; else if(n == 0) cout << 0 << endl; else cout << sum*2 << endl; }