import std.stdio, std.range, std.conv, std.string, std.array, std.functional, std.math;
import std.algorithm.comparison, std.algorithm.iteration, std.algorithm.mutation, std.algorithm.searching, std.algorithm.setops, std.algorithm.sorting;
import std.container.binaryheap;

void main()
{
    auto N = readln().strip.to!(long);
    
    long[4][4][4][] memo;
    memo.length = N+1;
    memo[0][3][3][3] = 1;

    foreach(i; 0..N) {
        foreach(c1; 0..4) {
            foreach(c2; 0..4) {
                foreach(c3; 0..4) {
                    foreach(a; 0..4) {
                        if(a==2&&c1==1&&c2==0)continue;
                        if(a==2&&c1==0&&c2==1)continue;
                        if(a==1&&c1==2&&c2==0)continue;
                        if(a==2&&c1==1&&c3==0)continue;
                        if(a==2&&c2==1&&c3==0)continue;
                        memo[i+1][a][c1][c2] += memo[i][c1][c2][c3];
                        memo[i+1][a][c1][c2] %= pow(10, 9) + 7;
                    }
                }
            }
        }
    }

    long res;
    foreach(c1; 0..4) {
        foreach(c2; 0..4) {
            foreach(c3; 0..4) {
                res += memo[N][c1][c2][c3];
                res %= pow(10, 9) + 7;
            }
        }
    }
    writeln(res);
}
