mod = 10 ** 9 + 7 n = int(input()) dp = [[0] * 3 for _ in range(n + 5)] dp[1][0] = 1 dp[2][1] = 1 dp[3][2] = 1 for i in range(1, n + 1): for j in range(3): for k in range(3): if j == k: continue dp[i+k+1][k] += dp[i][j] dp[i+k+1][k] %= mod ans = sum(dp[n][i] for i in range(3)) print(ans % mod)