#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
using edge = struct {
  int to;
  int cost;
};
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define BITS(n, num) std::bitset<(n)>((num)).to_string()
#define REV <T> greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp) % MOD;
  } else {
    return (n * POW(n, m - 1)) % MOD;
  }
}

int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

ll DP[102][5][5][5] = {};

// A,C,G,T

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N;
  cin >> N;
  REP(i, N) {
    if (i == 0) {
      continue;
    } else if (i == 1) {
      REP(p, 4) REP(q, 4) DP[1][p][q][4] = 1;
    } else if (i == 2) {
      REP(r, 4) REP(q, 4) REP(p, 4) {
        if (p == 0 && q == 1 && r == 2)
          continue;
        else if (p == 2 && q == 0 && r == 1)
          continue;
        else if (p == 0 && q == 2 && r == 1)
          continue;
        else {
          DP[i][p][q][r] += DP[i - 1][p][q][4];
          DP[i][p][q][r] %= MOD;
        }
      }
    } else {
      REP(s, 4) REP(r, 4) REP(q, 4) REP(p, 4) {
        if (p == 0 && q == 1 && r == 2)
          continue;
        else if (p == 2 && q == 0 && r == 1)
          continue;
        else if (p == 0 && q == 2 && r == 1)
          continue;
        else if (s == 0 && p == 2 && r == 1)
          continue;
        else if (s == 0 && q == 2 && r == 1)
          continue;
        else {
          DP[i][p][q][r] += DP[i - 1][s][p][q];
          DP[i][p][q][r] %= MOD;
        }
      }
    }
  }
  ll ans = 0;
  REP(p, 4) REP(q, 4) REP(r, 4) {
    // cout << p << "," << q << "," << DP[N - 1][p][q] << endl;
    ans = (ans + DP[N - 1][p][q][r]) % MOD;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 888