import sys sys.setrecursionlimit(10**6) mod = 10**9+7 n = int(input()) if(n <= 3): print(0) exit(0) def memo_dp(ldp,k): if(k == n): return ldp dp = [0]*8 dp[0] = (ldp[0] + ldp[4]) % mod dp[1] = (ldp[0] + ldp[4]) % mod dp[2] = ldp[1] dp[3] = (ldp[1] + ldp[5]) % mod dp[4] = (ldp[2] + ldp[6]) % mod dp[5] = (ldp[2] + ldp[6]) % mod dp[6] = (ldp[3] + ldp[7]) % mod dp[7] = (ldp[3] + ldp[7]) % mod return memo_dp(dp,k+1) dp = memo_dp([1]*8,3) ans = (pow(2,n,mod) + mod*10 - sum(dp)) % mod print(ans)