#include <iostream>
#include<iomanip>
#include <cmath>
#include <climits>
#include <algorithm>
#include <stdio.h>
#include <vector>
#include <queue>
#include <tuple>
#include <map>
#include <list>
#include <string>
#include <numeric>
#include <utility>
#include <cfloat>
#include <set>

using namespace std;

long long dp[101][4][4][4][4];
long long M = 1000000007;
int main(){
    int N;
    cin >> N;
    //A: 0 C: 1 G: 2 T: 3
    if(N == 3){
        cout << 61 << endl;
        return 0;
    }
    
    for(int i = 0; i < 4; i++){
        for(int j = 0; j < 4; j++){
            for(int k = 0; k < 4; k++){
                for(int l = 0; l < 4; l++){
                    if((j == 0 && k == 2 && l == 1) || (i == 0 && j == 2 && k == 1)){
                        //AGC
                        dp[3][i][j][k][l] = 0;
                    } else if((j == 0 && k == 1 && l == 2) || (i == 0 && j == 1 && k == 2)){
                        //ACG
                        dp[3][i][j][k][l] = 0;
                    } else if((j == 2 && k == 0 && l == 1) || (i == 2 && j == 0 && k == 1)){
                        //GAC
                        dp[3][i][j][k][l] = 0;
                    } else if(i == 0 && k == 2 && l == 1){
                        //A*GC
                        dp[3][i][j][k][l] = 0;
                    } else if(i == 0 && j == 2 && l == 1){
                        //AG*C
                        dp[3][i][j][k][l] = 0;
                    } else {
                        dp[3][i][j][k][l] = 1;
                    }
                }
            }
        }
    }

    for(int m = 4; m < N; m++){
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 4; j++){
                for(int k = 0; k < 4; k++){
                    for(int l = 0; l < 4; l++){
                        if((j == 0 && k == 2 && l == 1) || (i == 0 && j == 2 && k == 1)){
                            //AGC
                            dp[m][i][j][k][l] = 0;
                        } else if((j == 0 && k == 1 && l == 2) || (i == 0 && j == 1 && k == 2)){
                            //ACG
                            dp[m][i][j][k][l] = 0;
                        } else if((j == 2 && k == 0 && l == 1) || (i == 2 && j == 0 && k == 1)){
                            //GAC
                            dp[m][i][j][k][l] = 0;
                        } else if(i == 0 && k == 2 && l == 1){
                            //A*GC
                            dp[m][i][j][k][l] = 0;
                        } else if(i == 0 && j == 2 && l == 1){
                            //AG*C
                            dp[m][i][j][k][l] = 0;
                        } else {
                            long long tmp = 0;
                            for(int n = 0; n < 4; n++){
                                tmp = (tmp + dp[m - 1][n][i][j][k]) % M;
                            }
                            dp[m][i][j][k][l] = tmp;
                        }
                    }
                }
            }
        }
    }

    long long ans = 0;
    for(int i = 0; i < 4; i++){
        for(int j = 0; j < 4; j++){
            for(int k = 0; k < 4; k++){
                for(int l = 0; l < 4; l++){
                    ans = (ans + dp[N - 1][i][j][k][l]) % M;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}   

Measured memory_bytes: 384