#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <numeric>
#include <fstream>
#include <iomanip>

typedef long double ld;
typedef long long ll;
const ll INF = (ll)1e18 + 1;
const ll MOD = 1e9 + 7;

// Output
template<class T, class S> std::ostream& operator << (std::ostream& os, std::pair<T, S> p)
{
  return os << p.first << " " << p.second;
}

template<class T> std::ostream& operator << (std::ostream& os, std::vector< T > v)
{
  for (ll i = 0; i < (ll)v.size(); i++){ os << " [" << i << "]" << v[i]; if (i % 10 == 9) os << std::endl; }
  return os;
}

template<class T, class S> std::ostream& operator << (std::ostream& os, std::vector< std::pair<T, S> > vp)
{
  ll i = 0;
  for (auto p : vp){os << " [" << i++ << "]" << p.first << " " << p.second; if (i % 10 == 0) os << std::endl;}
  return os;
}

void print(){ std::cout << std::endl; }
template<typename H> void print(H head) { std::cout << head << std::endl; }
template<typename H, typename... T> void print(H head, T... tail){ std::cout << head << " ", print(tail...); }

ll idx(char ch)
{
  if (ch == 'A') return 0;
  if (ch == 'C') return 1;
  if (ch == 'G') return 2;
  return 3;
}

char ch(ll idx)
{
  if (idx == 0) return 'A';
  if (idx == 1) return 'C';
  if (idx == 2) return 'G';
  return 'T';
}

int main()
{
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  const ll MAX_N = 100;
  const ll MAX_KIND = 4;
  ll N;
  std::cin >> N;

  // A:0 C:1 G:2 T:3
  ll dp[MAX_N+1][MAX_KIND][MAX_KIND][MAX_KIND];
  for (ll i = 0; i <= N; i++) {
    for (ll k1 = 0; k1 < 4; k1++) {
      for (ll k2 = 0; k2 < 4; k2++) {
	for (ll k3 = 0; k3 < 4; k3++) {
	  dp[i][k1][k2][k3] = 0LL;
	}
      }
    }
  }

  for (ll k0 = 0; k0 < 4; k0++) {
    for (ll k1 = 0; k1 < 4; k1++) {
      for (ll k2 = 0; k2 < 4; k2++) {
	dp[3][k0][k1][k2] = 1;
      }
    }
  }
  dp[3][idx('A')][idx('C')][idx('G')] = 0;
  dp[3][idx('G')][idx('A')][idx('C')] = 0;
  dp[3][idx('A')][idx('G')][idx('C')] = 0;

  for (ll i = 4; i <= N; i++) {
    for (ll k0 = 0; k0 < 4; k0++) {
      for (ll k1 = 0; k1 < 4; k1++) {
	for (ll k2 = 0; k2 < 4; k2++) {
	  for (ll k3 = 0; k3 < 4; k3++) {
	    if ((k0 == idx('A') && k1 == idx('C') && k2 == idx('G')) ||
		(k0 == idx('G') && k1 == idx('A') && k2 == idx('C')) ||
		(k0 == idx('A') && k1 == idx('G') && k2 == idx('C'))) {
	      //print("Zero", i, ch(k0), ch(k1), ch(k2), ch(k3), dp[i][k0][k1][k2]);
	    } else if ((k0 == idx('A') && k2 == idx('G') && k3 == idx('C'))) {
	      //print("Zero", i, ch(k0), ch(k1), ch(k2), ch(k3), dp[i][k0][k1][k2]);
	    } else if ((k0 == idx('A') && k1 == idx('G') && k3 == idx('C'))) {
	      //print("Zero", i, ch(k0), ch(k1), ch(k2), ch(k3), dp[i][k0][k1][k2]);
	    } else {
	      dp[i][k0][k1][k2] += dp[i-1][k1][k2][k3];
	      dp[i][k0][k1][k2] %= MOD;
	      //print("Plus", i, ch(k0), ch(k1), ch(k2), ch(k3), dp[i][k0][k1][k2], "x:", dp[i-1][k1][k2][k3]);
	    }
	  }
	}
      }
    }
  }

  ll ans = 0LL;
  for (ll k0 = 0; k0 < 4; k0++) {
    for (ll k1 = 0; k1 < 4; k1++) {
      for (ll k2 = 0; k2 < 4; k2++) {
	ans += dp[N][k0][k1][k2];
	ans %= MOD;
      }
    }
  }

  print(ans);
  return 0;
}


Measured memory_bytes: 256