#include <bits/stdc++.h>
using namespace std;
#define eps 0.000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define seg_size 65536 * 2
#define REP(i, n) for (long long i = 0; i < n; ++i)

const long long MOD = 1000000007;
long long dp[4][4][4][4][200] = {};
bool swappable(int a, int b, int c, int d, int e)
{
    if (a == 0 && b == 1 && c == 2)
        return false;
    if (a == 1 && b == 0 && c == 2)
        return false;
    if (a == 0 && b == 2 && c == 1)
        return false;
    if (a == 0 && b == 1 && d == 2)
        return false;
    if (b == 0 && c == 1 && d == 2)
        return false;
    if (b == 1 && c == 0 && d == 2)
        return false;
    if (b == 0 && c == 2 && d == 1)
        return false;
    if (a == 0 && c == 1 && d == 2)
        return false;

    if (a == 0 && b == 1 && c == 2)
        return false;
    if (a == 1 && b == 0 && c == 2)
    {
        return false;
    }
    if (a == 0 && b == 2 && c == 1)
        return false;

    if (c == 0 && d == 1 && e == 2)
        return false;
    if (c == 1 && d == 0 && e == 2)
        return false;
    if (c == 0 && d == 2 && e == 1)
        return false;
    if (b == 0 && d == 1 && e == 2)
        return false;
    if (b == 0 && c == 1 && d == 2)
        return false;
    swap(a, b);
    if (b == 0 && c == 1 && d == 2)
        return false;
    swap(a, b);
    swap(b, c);
    if (b == 0 && c == 1 && d == 2)
        return false;
    swap(b, c);
    swap(c, d);
    if (b == 0 && c == 1 && d == 2)
        return false;
    swap(c, d);
    swap(d, e);
    if (b == 0 && c == 1 && d == 2)
        return false;
    swap(d, e);
    return true;
}
void solve(long long N)
{
    if (N == 3)
    {
        long long ans = 0;
        REP(i, 4)
        {
            REP(q, 4)
            {
                REP(j, 4)
                {
                    if (i == 0 && q == 1 && j == 2)
                        continue;
                    if (i == 1 && q == 0 && j == 2)
                        continue;
                    if (i == 0 && q == 2 && j == 1)
                        continue;
                    ans++;
                }
            }
        }
        cout << ans << endl;
        return;
    }
    else if (N == 4)
    {
        long long ans = 0;
        REP(i, 4)
        {
            REP(q, 4)
            {
                REP(j, 4)
                {
                    REP(t, 4)
                    {
                        if (i == 0 && q == 1 && j == 2)
                            continue;
                        if (i == 1 && q == 0 && j == 2)
                            continue;
                        if (i == 0 && q == 2 && j == 1)
                            continue;
                        if (i == 0 && q == 1 && t == 2)
                            continue;
                        if (q == 0 && j == 1 && t == 2)
                            continue;
                        if (q == 1 && j == 0 && t == 2)
                            continue;
                        if (q == 0 && j == 2 && t == 1)
                            continue;
                        if (i == 0 && j == 1 && t == 2)
                            continue;
                        ans++;
                    }
                }
            }
        }
        cout << ans << endl;
        return;
    }
    REP(i, 4)
    {
        REP(q, 4)
        {
            REP(j, 4)
            {
                if (i == 0 && q == 1 && j == 2)
                    continue;
                REP(a, 4)
                {
                    REP(b, 4)
                    {
                        if (swappable(i, q, j, a, b) == true)
                        {
                            dp[q][j][a][b][5]++;
                        }
                    }
                }
            }
        }
    }
    for (int i = 5; i < N; ++i)
    {
        REP(q, 4)
        {
            REP(j, 4)
            {
                REP(t, 4)
                {
                    REP(p, 4)
                    {
                        if (dp[q][j][t][p] != 0)
                        {
                            REP(u, 4)
                            {
                                if (swappable(q, j, t, p, u) == true)
                                {
                                    dp[j][t][p][u][i + 1] += dp[q][j][t][p][i];
                                    dp[j][t][p][u][i + 1] %= MOD;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    long long ans = 0;
    REP(i, 4)
    {
        REP(q, 4)
        {
            REP(j, 4)
            {
                REP(t, 4)
                {
                    ans += dp[i][q][j][t][N];
                    ans %= MOD;
                }
            }
        }
    }
    cout << ans % MOD << endl;
}

// Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    solve(N);
    return 0;
}


Measured memory_bytes: 640