mod = 10**9+7 n = int(input()) if(n <= 3): print(0) exit(0) dp = [[0]*8 for _ in range(n+1)] for j in range(8): dp[3][j] = 1 for i in range(3,n): dp[i+1][0] = (dp[i][0] + dp[i][4]) % mod dp[i+1][1] = (dp[i][0] + dp[i][4]) % mod dp[i+1][2] = dp[i][1] dp[i+1][3] = (dp[i][1] + dp[i][5]) % mod dp[i+1][4] = (dp[i][2] + dp[i][6]) % mod dp[i+1][5] = (dp[i][2] + dp[i][6]) % mod dp[i+1][6] = (dp[i][3] + dp[i][7]) % mod dp[i+1][7] = (dp[i][3] + dp[i][7]) % mod ans = (pow(2,n,mod) + mod*10 - sum(dp[n])) % mod print(ans)