MOD = 1000000007 N = int(input()) if N <= 2: print(N) exit() dp = [0] * (N + 1) dp[0] = 1 dp[2] = 1 for i in range(3, N + 1): dp[i] = (dp[i] + dp[i - 2] + dp[i - 3]) % MOD dp[N] = (dp[N] + dp[N - 1] + dp[N - 2]) % MOD print(dp[-1])