#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define int long long
using namespace std;
//T1 C2 A3 G4
int dp[5][5][5][110];
int mod = 1000000007;
signed main() {
	int n; cin >> n;
	dp[1][1][1][0] = 1;
	for (int i = 1; i <= n; i++) {
		for (int p = 1; p <= 4; p++) {
			for (int q = 1; q <= 4; q++) {
				for (int r = 1; r <= 4; r++) {
					for (int s = 1; s <= 4; s++) {
						if (q == 3 && r == 4 && s == 2);
						else if (p == 3 && (q == 4 || r == 4) && s == 2);
						else if (q == 4 && r == 3 && s == 2);
						else if (q == 3 && r == 2 && s == 4);
						else dp[q][r][s][i] += dp[p][q][r][i - 1];
						dp[q][r][s][i] %= mod;
					}
				}
			}
		}
	}
	int ans = 0;
	for (int p = 1; p <= 4; p++) for (int q = 1; q <= 4; q++) for (int r = 1; r <= 4; r++) {
		ans += dp[p][q][r][n]; ans %= mod;
	}
	cout << ans << endl;
}