N = int(input()) # dp[i][K] = i段目にきて、最後に使ったのがKステップである dp = [[0] * 4 for i in range(N + 1)] dp[0][0] = 1 DIV = 10 ** 9 + 7 for i in range(N): for from_k in range(4): for to_k in range(1, 4): if from_k == to_k: continue if i + to_k > N: continue dp[i + to_k][to_k] += dp[i][from_k] dp[i + to_k][to_k] %= DIV print(sum(dp[-1]) % DIV)