N = int(input()) if N<=3: exit(print(0)) dp = [1]*16 dp[10] = 0 MOD = 10**9+7 for _ in range(N-4): ndp = [0]*16 for S in range(16): for i in range(2): nS = S//2+8*i if nS!=10: ndp[nS] += dp[S] ndp[nS] %= MOD dp = ndp print((pow(2, N, MOD)-sum(dp))%MOD)