MOD = 10 ** 9 + 7



S = int(eval(input()))

dp = [0] * (S + 1)

dp[0] = 1

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

    if i >= 1:

        dp[i] += dp[i - 1]

    if i >= 3:

        dp[i] += dp[i - 3]

    dp[i] %= MOD

print((dp[S]))

MOD = 10 ** 9 + 7





def prepare(n):

    global MOD

    modFacts = [0] * (n + 1)

    modFacts[0] = 1

    for i in range(n):

        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD



    invs = [1] * (n + 1)

    invs[n] = pow(modFacts[n], MOD - 2, MOD)

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

        invs[i - 1] = (invs[i] * i) % MOD



    return modFacts, invs





def comb(n, r):

    global MOD, modFacts, invs

    return (modFacts[n] * invs[n - r] * invs[r]) % MOD





def perm(n, r):

    global MOD, modFacts, invs

    return (modFacts[n] * invs[n - r]) % MOD





S = int(eval(input()))

modFacts, invs = prepare(S)

ans = 0

for k in range(1, S // 3 + 1):

    s = S - 3 * k

    cnt = comb(k - 1 + s, s)

    ans += cnt

    ans %= MOD

print(ans)

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

MOD = 10**9 + 7


def prepare(n):
    global MOD
    modFacts = [0] * (n + 1)
    modFacts[0] = 1
    for i in range(n):
        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD
    invs = [1] * (n + 1)
    invs[n] = pow(modFacts[n], MOD - 2, MOD)
    for i in range(n, 1, -1):
        invs[i - 1] = (invs[i] * i) % MOD
    return modFacts, invs


def comb(n, r):
    global MOD, modFacts, invs
    return (modFacts[n] * invs[n - r] * invs[r]) % MOD


def perm(n, r):
    global MOD, modFacts, invs
    return (modFacts[n] * invs[n - r]) % MOD


S = int(eval(input()))
modFacts, invs = prepare(S)
ans = 0
for k in range(1, S // 3 + 1):
    s = S - 3 * k
    cnt = comb(k - 1 + s, s)
    ans += cnt
    ans %= MOD
print(ans)

+ + +def prepare(n): +    global MOD +    modFacts = [0] * (n + 1) +    modFacts[0] = 1 +    for i in range(n): +        modFacts[i + 1] = (modFacts[i] * (i + 1)) % MOD +    invs = [1] * (n + 1) +    invs[n] = pow(modFacts[n], MOD - 2, MOD) +    for i in range(n, 1, -1): +        invs[i - 1] = (invs[i] * i) % MOD +    return modFacts, invs + + +def comb(n, r): +    global MOD, modFacts, invs +    return (modFacts[n] * invs[n - r] * invs[r]) % MOD + + +def perm(n, r): +    global MOD, modFacts, invs +    return (modFacts[n] * invs[n - r]) % MOD + + -dp = [0] * (S + 1) -dp[0] = 1 -for i in range(3, S + 1): -    if i >= 1: -        dp[i] += dp[i - 1] -    if i >= 3: -        dp[i] += dp[i - 3] -    dp[i] %= MOD -print((dp[S])) +modFacts, invs = prepare(S) +ans = 0 +for k in range(1, S // 3 + 1): +    s = S - 3 * k +    cnt = comb(k - 1 + s, s) +    ans += cnt +    ans %= MOD +print(ans)