import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ####################################################################### ans = 0 n = ni() mod = 10**9+7 if n <= 3: print(0) exit() z = 15 dp = [[0 for j in range(16)]for i in range(n+1)] dp[0][0] = 1 for i in range(n): for j in range(16): for k in range(2): ni = i + 1 nj = z&((j<<1)|k) if nj == 10: continue dp[ni][nj] += dp[i][j] dp[ni][nj] %= mod print((pow(2,n,mod)-sum(dp[-1]))%mod)