#include using namespace std; using ll = long long; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define all(x) (x).begin(),(x).end() #define pb push_back #define fi first #define se second #define dbg(x) cout<<#x" = "<<((x))< ostream& operator<<(ostream& o, const pair &p){o<<"("< ostream& operator<<(ostream& o, const vector &v){o<<"[";for(T t:v){o<>=1; } return ret; } ll solve(ll n) { if(n==1) return 2; ll ret = 1; if(n%2==1) { --n; ret = 3; } n-=2; ret*=4; (ret*=mod_pow(5,n/2))%=mod; return ret; } int main() { ll n; cin >>n; cout << solve(n) << endl; return 0; }