#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
template<class T>bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;

	int dp[110][4][4][4] = { 0 };

	//0-A,1-C,2-G,3-T
	
	REP(b, 4) {
		REP(c, 4) {
			REP(d, 4) {

				if (d == 3) {
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
				}
				if (d == 2) {
					if (b == 0 && c == 1)continue;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
				}
				if (d == 1) {
					if (b == 0 && c == 2)continue;
					if (b == 2 && c == 0)continue;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
				}
				if (d == 0) {
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
					dp[3][b][c][d] = 1;
				}

				dp[3][b][c][d] %= mod;
			}
		}
	}
	

	eFOR(i, 4, N) {
		REP(b, 4) {
			REP(c, 4) {
				REP(d, 4) {

					if (d == 3) {
						dp[i][b][c][d] += dp[i - 1][0][b][c];
						dp[i][b][c][d] += dp[i - 1][1][b][c];
						dp[i][b][c][d] += dp[i - 1][2][b][c];
						dp[i][b][c][d] += dp[i - 1][3][b][c];
					}
					if (d == 2) {
						if (b == 0 && c == 1)continue;
						dp[i][b][c][d] += dp[i - 1][0][b][c];
						dp[i][b][c][d] += dp[i - 1][1][b][c];
						dp[i][b][c][d] += dp[i - 1][2][b][c];
						dp[i][b][c][d] += dp[i - 1][3][b][c];
					}
					if (d == 1) {
						if (b == 0 && c == 2)continue;
						if (b == 2 && c == 0)continue;
						dp[i][b][c][d] += dp[i - 1][0][b][c];
						dp[i][b][c][d] += dp[i - 1][1][b][c];
						dp[i][b][c][d] += dp[i - 1][2][b][c];
						dp[i][b][c][d] += dp[i - 1][3][b][c];
						if (b == 2||c==2)dp[i][b][c][d] -= dp[i - 1][0][b][c];
						//if (c == 2)dp[i][b][c][d] -= dp[i - 1][0][b][c];
					}
					if (d == 0) {
						dp[i][b][c][d] += dp[i - 1][0][b][c];
						dp[i][b][c][d] += dp[i - 1][1][b][c];
						dp[i][b][c][d] += dp[i - 1][2][b][c];
						dp[i][b][c][d] += dp[i - 1][3][b][c];
					}

					dp[i][b][c][d] %= mod;
				}
			}
		}		
	}
	int ans = 0;
	REP(a, 4) {
		REP(b, 4) {
			REP(c, 4) {
				//if (a == 0 && b == 2 && c == 1)cout << dp[N][a][b][c] << endl;
				ans += dp[N][a][b][c];
				ans %= mod;
			}
		}
	}

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



Measured memory_bytes: 256