#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

ll mypow(ll x,ll n){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret = (ret*x)%MOD;
        }
        x = (x*x)%MOD;
        n >>= 1;
    }
    return ret;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n;

    cin >> n;

    ll dp[101][5][5][5][5];

    for(int i = 0; i < 101; i++){
        for(int j = 0; j < 5; j++){
            for(int k = 0; k < 5; k++){
                for(int z = 0; z < 5; z++){
                    for(int x = 0; x < 5; x++){
                        dp[i][j][k][z][x] = 0;
                    }
                }
            }
        }
    }

    dp[0][0][0][0][0] = 1;

    for(int i = 1; i < n+1; i++){
        for(int j = 1; j < 5; j++){
            for(int k = 0; k < 5; k++){
                for(int z = 0; z < 5; z++){
                    for(int x = 0; x < 5; x++){
                        for(int y = 0; y < 5; y++){
                            if(k == 1 && z == 2 && x == 3){
                                continue;
                            }else if(z == 1 && x == 2 && y == 3){
                                continue;
                            }else if(k == 2 && z == 1 && x == 3){
                                continue;
                            }else if(z == 2 && x == 1 && y == 3){
                                continue;
                            }else if(k == 1 && z == 3 && x == 2){
                                continue;
                            }else if(z == 1 && x == 3 && y == 2){
                                continue;
                            }else if(k == 1 && x == 2 && z == 3){
                                continue;
                            }else if(k == 1 && z == 2 && y == 3){
                                continue;
                            }else if(x == 1 && y == 2 && j == 3){
                                continue;
                            }else if(x == 2 && y == 1 && j == 3){
                                continue;
                            }else if(x == 1 && y == 3 && j == 2){
                                continue;
                            }else if(z == 1 && y == 2 && j == 3){
                                continue;
                            }else if(z == 1 && x == 2 && j == 3){
                                continue;
                            }
                            dp[i][z][x][y][j] += dp[i-1][k][z][x][y];
                            dp[i][z][x][y][j] %= MOD;
                        }
                    }
                }
            }
        }
    }

    ll ans = 0;

    
        for(int j = 0; j < 5; j++){
            for(int k = 0; k < 5; k++){
                for(int z = 0; z < 5; z++){
                    for(int x = 0; x < 5; x++){
                        ans += dp[n][j][k][z][x];
                        ans %= MOD;
                    }
                }
            }
        }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 768