#include <iostream>
using namespace std;
#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main()
{
  int N;
  cin >> N;
  int A = 0;
  int C = 1;
  int G = 2;
  long dp[101][5][5][5] = {};
  dp[0][4][4][4] = 1;
  REP(i, N)
  REP(j, 5)
  REP(k, 5)
  REP(l, 5)
  REP(m, 4)
  {
    if (k == A && l == G && m == C)
      continue;
    if (k == A && l == C && m == G)
      continue;
    if (k == G && l == A && m == C)
      continue;
    if (j == A && l == G && m == C)
      continue;
    if (j == A && k == G && m == C)
      continue;
    dp[i + 1][k][l][m] += dp[i][j][k][l];
    dp[i + 1][k][l][m] %= MOD;
  }

  long ans = 0;
  REP(j, 4)
  REP(k, 4)
  REP(l, 4)
  {
    ans += dp[N][j][k][l];
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}