#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=30;

int main(){
    
    int N;cin>>N;
    ll dp[4][4][4][101];//A=0 C=1 G=2 T=3
    for(int i=0;i<4;i++){
        for(int j=0;j<4;j++){
            for(int k=0;k<4;k++){
                for(int l=0;l<101;l++){
                    if(l!=3) dp[i][j][k][l]=0;
                    else dp[i][j][k][l]=1;
                }
            }
        }
    }
    dp[0][2][1][3]=0;
    dp[0][1][2][3]=0;
    dp[2][0][1][3]=0;
    
    for(int l=3;l<N;l++){
        for(int i=0;i<4;i++){
            for(int j=0;j<4;j++){
                for(int k=0;k<4;k++){
                    if(j==0&&k==1){
                        dp[0][1][0][l+1]=(dp[0][1][0][l+1]+dp[i][j][k][l])%mod;
                        dp[0][1][1][l+1]=(dp[0][1][1][l+1]+dp[i][j][k][l])%mod;
                        dp[0][1][3][l+1]=(dp[0][1][3][l+1]+dp[i][j][k][l])%mod;
                    }else if(j==0&&k==2){
                        dp[0][2][0][l+1]=(dp[0][2][0][l+1]+dp[i][j][k][l])%mod;
                        dp[0][2][2][l+1]=(dp[0][2][2][l+1]+dp[i][j][k][l])%mod;
                        dp[0][2][3][l+1]=(dp[0][2][3][l+1]+dp[i][j][k][l])%mod;
                    }else if(j==2&&k==0){
                        dp[2][0][0][l+1]=(dp[2][0][0][l+1]+dp[i][j][k][l])%mod;
                        dp[2][0][2][l+1]=(dp[2][0][2][l+1]+dp[i][j][k][l])%mod;
                        dp[2][0][3][l+1]=(dp[2][0][3][l+1]+dp[i][j][k][l])%mod;
                    }else if(i==0&&j==2&&k==2){
                        dp[2][2][0][l+1]=(dp[2][2][0][l+1]+dp[i][j][k][l])%mod;
                        dp[2][2][2][l+1]=(dp[2][2][2][l+1]+dp[i][j][k][l])%mod;
                        dp[2][2][3][l+1]=(dp[2][2][3][l+1]+dp[i][j][k][l])%mod;
                    }else if(i==0&&j==2&&k==3){
                        dp[2][3][0][l+1]=(dp[2][3][0][l+1]+dp[i][j][k][l])%mod;
                        dp[2][3][2][l+1]=(dp[2][3][2][l+1]+dp[i][j][k][l])%mod;
                        dp[2][3][3][l+1]=(dp[2][3][3][l+1]+dp[i][j][k][l])%mod;
                    }else if(i==0&&j==3&&k==2){
                        dp[3][2][0][l+1]=(dp[3][2][0][l+1]+dp[i][j][k][l])%mod;
                        dp[3][2][2][l+1]=(dp[3][2][2][l+1]+dp[i][j][k][l])%mod;
                        dp[3][2][3][l+1]=(dp[3][2][3][l+1]+dp[i][j][k][l])%mod;
                    }else if(!(i==0&&j==2&&k==1)||!(i==0&&j==1&&k==2)||!(i==2&&j==0&&k==1)){
                        dp[j][k][0][l+1]=(dp[j][k][0][l+1]+dp[i][j][k][l])%mod;
                        dp[j][k][1][l+1]=(dp[j][k][1][l+1]+dp[i][j][k][l])%mod;
                        dp[j][k][2][l+1]=(dp[j][k][2][l+1]+dp[i][j][k][l])%mod;
                        dp[j][k][3][l+1]=(dp[j][k][3][l+1]+dp[i][j][k][l])%mod;
                    }
                }
            }
        }
    }
    
    ll ans=0;
    
    for(int i=0;i<4;i++){
        for(int j=0;j<4;j++){
            for(int k=0;k<4;k++){
                //if(k) cout<<" ";
                ans+=dp[i][j][k][N];
                ans=ans%mod;
                //cout<<dp[i][j][k][N];
            }
            //cout<<endl;
        }
    }
    
    cout<<ans<<endl;
    
}


Measured memory_bytes: 256