#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<cstring>

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LLINF = 1LL<<60;
#define P pair<ll, ll>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl

class mint {
    long long x;
public:
    mint(long long x=0) : x((x%MOD+MOD)%MOD) {}
    mint operator-() const {
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }

    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};
/* -- template -- */

int dp[101][4][4][4];//dp[i + 1][ppprev][pprev][prev] : 文字列長iを作るための通り数

int main() {
    int N; cin >> N;
    rep(pprev, 4){
        rep(prev, 4){
            rep(now, 4){
                if(pprev == 0 && prev == 1 && now == 2)continue;
                if(pprev == 0 && prev == 2 && now == 1)continue;
                if(pprev == 2 && prev == 0 && now == 1)continue;
                dp[3][pprev][prev][now] = 1;
            }
        }
    }
    for(int i = 3; i < N; ++i) {
        for(int pprev = 0; pprev < 4; ++pprev) {
            for(int prev = 0; prev < 4; ++prev) {
                for(int now = 0; now < 4; ++now){
                    for(int ppprev = 0; ppprev < 4; ++ppprev) {
                    if(ppprev == 0 && prev == 2 && now == 1)continue;
                    if(ppprev == 0 && pprev == 2 && now == 1)continue;
                    if(pprev == 0 && prev == 1 && now == 2)continue;
                    if(pprev == 0 && prev == 2 && now == 1)continue;
                    if(pprev == 2 && prev == 0 && now == 1)continue;
                    dp[i + 1][pprev][prev][now] = (dp[i + 1][pprev][prev][now] + dp[i][ppprev][pprev][prev]) % MOD;
                    }
                }
            }
        }
    }

    int ans = 0;
    for(int pprev = 0; pprev < 4; ++pprev) {
        for(int prev = 0; prev < 4; ++prev) {
            for(int now = 0; now < 4; ++now){
                ans = (ans + dp[N][pprev][prev][now]) % MOD;
            }
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256