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