#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1000000007;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

const int mod = 1000000007;
class mint {
    long long x;
public:
    mint(long long x=0) : x((x%mod+mod)%mod) {}
    mint operator-() const { 
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }
 
    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};
/*
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} comb(200010);*/
mint dp[101][4][4][4];
int main(){
    ll N;
    cin >> N;
    dp[0][3][3][3] = 1;
    rep(i,N)rep(c1,4)rep(c2,4)rep(c3,4){
        rep(a,4){
            if(c2 == 0 && c1 == 2 && a==1) continue;
            if(c2 == 0 && c1 == 1 && a==2) continue;
            if(c2 == 2 && c1 == 0 && a==1) continue;
            if(c3 == 0 && c1 == 2 && a==1) continue;
            if(c3 == 0 && c2 == 2 && a==1) continue;
            dp[i+1][a][c1][c2] += dp[i][c1][c2][c3];
        }
    }
    mint ans=0;
    rep(c1,4)rep(c2,4)rep(c3,4){
        ans += dp[N][c1][c2][c3];
    }
    cout << ans << endl;
    //vector<vector<mint>> dp(N+1, vector<mint>(64, 0));// A=0, C=1, G=2, T=3
    //AGC = 0*4*4 + 2*4 + 1
    /*
    ll a = 0*4*4 + 2*4 + 1; // AGC
    ll b = 0*4*4 + 1*4 + 2; // ACG
    ll c = 2*4*4 + 0*4 + 1; // GAC
    ll d = 0*4*4 + 2;// A?GC
    ll e = 0*4*4 + 2*4;// AG?C
    rep(i,64){
        dp[3][i] = 1;
    }
    mint ans = 1;
    rep(i,N){
        ans *= 4;
    }
    REP(i,3,N){
        rep(j,4){
            dp[i+1][a] += dp[i][j*4*4 + 0*4 + 2]; //*AG
            dp[i+1][b] += dp[i][j*4*4 + 0*4 + 1]; //*AC
            dp[i+1][c] += dp[i][j*4*4 + 2*4 + 0]; //*GA
            if(j != 1){
                dp[i+1][d+j*4] += dp[i][0*4*4 + j*4 +2]; //A?G
                dp[i+1][e+j] += dp[i][0*4*4 + 2*4 + j]; //AG?
            }
        }
    }
    REP(i,3,N+1){
        cout << ans << endl;
        ans -= dp[i][a];
        ans -= dp[i][b];
        ans -= dp[i][c];
        rep(j,4){
            if(j==1)continue;
            ans -= dp[i-1][0*4*4 + j*4 + 2];
            ans -= dp[i-1][0*4*4 + 2*4 + j];
        }
    }
    cout << ans << endl;
    /*
    mint ans = 1;
    rep(i,N){
        ans *= 4;
    }
    mint tmp = ans/64;
    tmp *= N-2;
    tmp *= 3;
    
    mint ump = ans/64;
    ump *= 3;
    ump *= N-2;
    mint cc = 1;
    rep(i,N){
        cc *= 3;
    }
    cc /= 27;
    cc *= 3;
    cc *= N-2;// maru 4
    //mint a n n n     nnnnnn nbnbnnbbbb n nbnb　 = (ump - cc);
    cout << cc << endl;
    cc *= 2;
    ans -= tmp;
    ans -= cc;
    cout << ans << endl;*/
}

Measured memory_bytes: 3616