MOD = 10 ** 9 + 7 N = int(input()) tmp = [1, 1, 3] if N <= 3: print(tmp[N - 1]) exit() dp = [[0, 0, 0] for _ in range(N + 1)] dp[1][0] = 1 dp[2][1] = 1 dp[3][0] = 1 dp[3][1] = 1 dp[3][2] = 1 for i in range(4, N + 1): for j in range(3): dp[i][j] += dp[i - j - 1][(j + 1) % 3] dp[i][j] += dp[i - j - 1][(j + 2) % 3] dp[i][j] %= MOD #for i in range(N + 1): # print(i, dp[i]) print(sum(dp[N]) % MOD)