#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
using namespace std;
// namespace boost::multiprecision;
// using Bint = cpp_int;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a), i##_len = (b); i < i##_len; ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define _repr(i, n) repri(i, n, 0)
#define repri(i, a, b) for(int i = int(a), i##_len = (b); i >= i##_len; --i)
/* 閉区間で定義しているので注意！repr(i,n,m)でn〜mまで */
#define repr(...) _overload3(__VA_ARGS__, repri, _repr, )(__VA_ARGS__)
/* 逆回しのループ。両閉区間であることに注意 */
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << ": " << (x) << '\n'
typedef long long lint;
#define int lint
#define endl '\n'
const int INF = (int)1145141919;
// int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const lint LINF = (lint)1e18;
typedef vector<int> vint;
typedef pair<int, int> pint;
template <class T> bool chmax(T &a, const T &b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> bool chmin(T &a, const T &b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T, class U>
std::ostream &operator<<(std::ostream &os, const std::pair<T, U> p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
    os << p.first << " " << p.second;
    return os;
}

template <typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << "[";
    for(int i = 0; i < (int)v.size(); i++) {
        os << v[i] << (i + 1 != v.size() ? ", " : "");
    }
    os << "]";
    return os;
}

template <typename T> istream &operator>>(istream &is, vector<T> &v) {
    for(T &in : v)
        is >> in;
    return is;
}

template <typename T = lint> vector<T> make_v(size_t a) { return vector<T>(a); }

template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) {
    t = v;
}

template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) {
    for(auto &e : t)
        fill_v(e, v);
}

const long long MOD = 1000000007;

/* templates */ /* templates */ /* templates */ /* templates */ /* templates */
/* make directory: atcoder-tools gen コンテスト略称(ex.agc033) */
/* テストコード：atcoder-tools test */
/* 提出：atcoder-tools submit -u */

signed main() {
#ifdef LOCAL
    ifstream in("in_3.txt");
    cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif

    /* input part */
    long long N;
    cin >> N;

    /* write your code!*/
    auto dp = make_v<int>(N + 10, 5, 5, 5);
    fill_v(dp,0);
    dp[0][4][4][4] = 1;
    rep(i, N) {
        rep(x, 5) {
            rep(y, 5) {
                rep(z, 5) {
                    rep(j, 4) {
                        if(y == 0 && z == 1 && j == 2)
                            continue;
                        else if(y == 0 && z == 2 && j == 1)
                            continue;
                        else if(y == 1 && z == 0 && j == 2)
                            continue;
                        else if(x == 0 && y == 1 && j == 2)
                            continue;
                        else if(x == 0 && z == 1 && j == 2)
                            continue;
                        else dp[i+1][y][z][j] += dp[i][x][y][z];

                        dp[i+1][y][z][j] %= MOD;
                    }
                }
            }
        }
    }
    int ans = 0LL;
    rep(x,5){
        rep(y,5){
            rep(z,5){
                ans += dp[N][x][y][z]%MOD;
            }
        }
    }
    cout << ans%MOD << endl;
}


Measured memory_bytes: 512