#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;

typedef long long ll;
ll M = 1e9 + 7;
ll n, d[105][500];
ll f(ll p, ll q) {
	ll i, z, s = 0;
	if (d[p][q] != -1) return d[p][q];
	if (p == n) return 1;
	for (i = 1; i <= 4; i++) {
		z = (q % 100) * 10 + i;
		if (z == 123 || z == 132 || z == 213) continue;
		if ((q / 100) == 1 && (q % 10) == 2 && i == 3) continue;
		if ((q / 10) == 12 && i == 3) continue;
		s = (s + f(p + 1, z)) % M;
	}
	return d[p][q] = s;
}
int main()
{
	cin >> n;
	memset(d, -1, sizeof(d));
	cout << f(0, 0);
    return 0;
}
