MOD = 10 ** 9 + 7 n = int(input()) dp = [[0] * 5 for _ in range(n + 1)] dp[0][0] = 1 for i in range(1, n + 1): # X[i] == "1" dp[i][1] += dp[i - 1][0] dp[i][1] += dp[i - 1][1] dp[i][3] += dp[i - 1][2] dp[i][1] += dp[i - 1][3] dp[i][4] += dp[i - 1][4] # X[i] == "0" dp[i][0] += dp[i - 1][0] dp[i][2] += dp[i - 1][1] dp[i][0] += dp[i - 1][2] dp[i][4] += dp[i - 1][3] dp[i][4] += dp[i - 1][4] for j in range(5): dp[i][j] %= MOD print(dp[-1][-1])