S = int(eval(input()))



dp = [0] * (S + 1)

dp[0] = 1

M = 10 ** 9 + 7



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

    num = 0

    for j in range(i - 2):

        num += dp[j]

        dp[i] = num % M



print((dp[S]))



S = int(eval(input()))





def cmb(n, r, p):

    r = min(n - r, r)

    if r == 0:

        return 1

    over = 1

    for i in range(n, n - r, -1):

        over = over * i % p

    under = 1

    for i in range(1, r + 1):

        under = under * i % p

    inv = pow(under, p - 2, p)

    return over * inv % p





M = 10 ** 9 + 7

ans = 0

for i in range(1, S):

    if S - 3 * i < 0:

        break

    ans += cmb(S - 3 * i + i - 1, i - 1, M)

    ans %= M

print(ans)

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

S = int(eval(input()))


def cmb(n, r, p):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = 1
    for i in range(n, n - r, -1):
        over = over * i % p
    under = 1
    for i in range(1, r + 1):
        under = under * i % p
    inv = pow(under, p - 2, p)
    return over * inv % p


M = 10**9 + 7
ans = 0
for i in range(1, S):
    if S - 3 * i < 0:
        break
    ans += cmb(S - 3 * i + i - 1, i - 1, M)
    ans %= M
print(ans)

-dp = [0] * (S + 1) -dp[0] = 1 + + +def cmb(n, r, p): +    r = min(n - r, r) +    if r == 0: +        return 1 +    over = 1 +    for i in range(n, n - r, -1): +        over = over * i % p +    under = 1 +    for i in range(1, r + 1): +        under = under * i % p +    inv = pow(under, p - 2, p) +    return over * inv % p + + -for i in range(1, S + 1): -    num = 0 -    for j in range(i - 2): -        num += dp[j] -        dp[i] = num % M -print((dp[S])) +ans = 0 +for i in range(1, S): +    if S - 3 * i < 0: +        break +    ans += cmb(S - 3 * i + i - 1, i - 1, M) +    ans %= M +print(ans)