import sys input = sys.stdin.readline MOD = 10 ** 9 + 7 n = int(input()) if(n <= 3): exit(print(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] % MOD 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) - sum(dp[n])) % MOD print(ans)