N = int(input()) mod = 10**9+7 dp = [[0]*3 for _ in range(N+1)] dp[0][0] = 1 for i in range(1, N+1): if i == 1: dp[i][0] = 1 elif i == 2: dp[i][1] = 1 else: for j in range(3): dp[i][j] = dp[i-j-1][(j+1)%3]+dp[i-j-1][(j+2)%3] dp[i][j] %= mod print(sum(dp[-1])%mod)