#include <bits/stdc++.h>
using namespace std;
using ll=long long;
const int MOD=1e9+7;

ll dp[110][6][6][6];

bool ng(int a,int b,int c){
  return a==1&&b==2&&c==3;
}

bool check(int a,int b,int c,int d){
  return ng(a,b,c)||ng(b,a,c)||ng(a,c,d)||ng(a,c,b)||ng(a,b,d);
}

ll f(int idx,int a,int b,int c){
  if(~dp[idx][a][b][c])return dp[idx][a][b][c];
  if(!idx)return 1;
  ll res=0;
  for(int i=0;i<4;i++)if(!check(i,a,b,c))res+=f(idx-1,i,a,b);
  return dp[idx][a][b][c]=res%MOD;
}

int main(){
  memset(dp,-1,sizeof(dp));
  int n;cin>>n;
  cout<<f(n,5,5,5)<<endl;
}
