#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int dp[101][4][4][4];
const ll mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  dp[0][3][3][3] = 1;
  for (int len = (0); len < (n); ++len) {
    for (int i = (0); i < (4); ++i) {
      for (int j = (0); j < (4); ++j) {
        for (int k = (0); k < (4); ++k) {
          if (dp[len][i][j][k] == 0) continue;
          for (int a = (0); a < (4); ++a) {
            if (a == 2 && i == 1 && j == 0) continue;
            if (a == 2 && i == 0 && j == 1) continue;
            if (a == 1 && i == 2 && j == 0) continue;
            if (a == 2 && i == 1 && k == 0) continue;
            if (a == 2 && j == 1 && k == 0) continue;
            dp[len + 1][a][i][j] += dp[len][i][j][k];
            dp[len + 1][a][i][j] %= mod;
          }
        }
      }
    }
  }
  int ans = 0;
  for (int c1 = (0); c1 < (4); ++c1) {
    for (int c2 = (0); c2 < (4); ++c2) {
      for (int c3 = (0); c3 < (4); ++c3) {
        ans += dp[n][c1][c2][c3];
        ans %= mod;
      }
    }
  }
  cout << ans << endl;
}
