from itertools import accumulate



S = int(eval(input()))

mod = 10**9 + 7

if S == 1 or S == 2:

    print((0))

    exit()

dp = [0] * (S + 1)

dp[0] = 1

ans = 0

for i in range(S):

    cum = list(accumulate(dp))

    for j in range(S, 2, -1):

        dp[j] = cum[j-3] % mod

    dp[0] = dp[1] = dp[2] = 0

    ans = (ans + dp[S]) % mod

print(ans)
S = int(eval(input()))

mod = 10**9 + 7

dp = [0] * (S + 1)

dp[0] = 1

for i in range(3, S + 1):

    dp[i] = (dp[i-1] + dp[i-3]) % mod

print((dp[S]))
from itertools import accumulate

S = int(eval(input()))
mod = 10**9 + 7
if S == 1 or S == 2:
    print((0))
    exit()
dp = [0] * (S + 1)
dp[0] = 1
ans = 0
for i in range(S):
    cum = list(accumulate(dp))
    for j in range(S, 2, -1):
        dp[j] = cum[j - 3] % mod
    dp[0] = dp[1] = dp[2] = 0
    ans = (ans + dp[S]) % mod
print(ans)

S = int(eval(input()))
mod = 10**9 + 7
dp = [0] * (S + 1)
dp[0] = 1
for i in range(3, S + 1):
    dp[i] = (dp[i - 1] + dp[i - 3]) % mod
print((dp[S]))

-from itertools import accumulate - -if S == 1 or S == 2: -    print((0)) -    exit() -ans = 0 -for i in range(S): -    cum = list(accumulate(dp)) -    for j in range(S, 2, -1): -        dp[j] = cum[j - 3] % mod -    dp[0] = dp[1] = dp[2] = 0 -    ans = (ans + dp[S]) % mod -print(ans) +for i in range(3, S + 1): +    dp[i] = (dp[i - 1] + dp[i - 3]) % mod +print((dp[S]))