#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
#define ALL(x) (x).begin(), (x).end()
#define rt return
#define dll(x) scanf("%I64d",&x)
#define xll(x) printf("%I64d\n",x)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rep(i,x,n) for(int i=x;i<n;i++)
#define repd(i,x,n) for(int i=x;i<=n;i++)
#define pii pair<int,int>
#define pll pair<long long ,long long>
#define gbtb ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MS0(X) memset((X), 0, sizeof((X)))
#define MSC0(X) memset((X), '\0', sizeof((X)))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define eps 1e-6
#define gg(x) getInt(&x)
#define db(x) cout<<"== [ "<<x<<" ] =="<<endl;
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll powmod(ll a,ll b,ll MOD){ll ans=1;while(b){if(b%2)ans=ans*a%MOD;a=a*a%MOD;b/=2;}return ans;}
inline void getInt(int* p);
const int maxn=1000010;
const int inf=0x3f3f3f3f;
/*** TEMPLATE CODE * * STARTS HERE ***/
int n;
const ll mod = 1e9+7ll;
ll dp[110][5][5][5];
char c[6]={'A','C','G','T'};
int main()
{
    //freopen("D:\\common_text\\code_stream\\in.txt","r",stdin);
	//freopen("D:\\common_text\\code_stream\\out.txt","w",stdout);
	// gbtb*/
	cin>>n;
	string temp="123";
	int num=0;
	// repd(i,0,3)
	// {
	// 	temp[0]=c[i];
	// 	repd(j,0,3)
	// 	{
	// 		temp[1]=c[j];
	// 		repd(k,0,3)
	// 		{
	// 			temp[2]=c[k];
	// 			cout<<num++<<" ";
	// 			cout<<temp<<endl;
	// 		}
	// 	}
	// }
	// char c[6]={'A','C','G','T'};
	repd(i,0,3)
	{
		repd(j,0,3)
		{
			repd(k,0,3)
			{
				dp[3][i][j][k]=1;
			}
		}
	}
	dp[3][0][1][2]=0;
	dp[3][0][2][1]=0;
	dp[3][2][0][1]=0;
	ll cnt=0ll;
	repd(len,4,n)
	{
		repd(i,0,3)
		{
			repd(j,0,3)
			{
				repd(k,0,3)
				{
					cnt=0ll;

					repd(ii,0,3)
					{
						repd(jj,0,3)
						{
							repd(kk,0,3)
							{
								//{'A','C','G','T'};
								if(jj==i&&kk==j)
								{
									if(k==1&&kk==2&&jj==0)
									{

									}else if(k==1&&kk==0&&jj==2)
									{

									}else if(k==2&&kk==1&&jj==0)
									{

									}else if(k==1&&kk==2&&ii==0)
									{

									}else if(k==1&&jj==2&&ii==0)
									{

									}else
									{
										cnt+=dp[len-1][ii][jj][kk];
										cnt=(cnt+mod)%mod;
									}
								}


							}
						}
					}
                    cnt=(cnt+mod)%mod;
					dp[len][i][j][k]=cnt;
//					printf("%d %d %d %lld\n",i,j,k,cnt);
				}
			}
		}
	}
	ll ans=0ll;
	repd(i,0,3)
	{
		repd(j,0,3)
		{
			repd(k,0,3)
			{
				ans+=dp[n][i][j][k];
                ans=(ans+mod)%mod;
            }

		}
	}
	cout<<ans<<endl;
    return 0;
}

inline void getInt(int* p) {
    char ch;
    do {
        ch = getchar();
    } while (ch == ' ' || ch == '\n');
    if (ch == '-') {
        *p = -(getchar() - '0');
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 - ch + '0';
        }
    }
    else {
        *p = ch - '0';
        while ((ch = getchar()) >= '0' && ch <= '9') {
            *p = *p * 10 + ch - '0';
        }
    }
}



Measured memory_bytes: 384