MOD = 10**9 + 7

def comb(n, k):

    if n < k or n < 0 or k < 0:

        return 0

    if k == 0:

        return 1

    iinv = [1] * (k + 1)

    ans = n

    for i in range(2, k + 1):

        iinv[i] = MOD - iinv[MOD % i] * (MOD // i) % MOD

        ans *= (n + 1 - i) * iinv[i] % MOD

        ans %= MOD

    return ans

S = int(eval(input()))

ans = 0

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

    tmp = S

    tmp -= i*3

    if tmp < 0:

        continue

    ans += comb(i+tmp-1,tmp)

    ans %= MOD

print(ans)

MOD = 10**9 + 7

S = int(eval(input()))

dp = [0]*(S+4)

dp[0] = 1

dp[3] = 1

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

    for k in range(i-2):

        dp[i] += dp[k]

print((dp[S]%MOD))
MOD = 10**9 + 7


def comb(n, k):
    if n < k or n < 0 or k < 0:
        return 0
    if k == 0:
        return 1
    iinv = [1] * (k + 1)
    ans = n
    for i in range(2, k + 1):
        iinv[i] = MOD - iinv[MOD % i] * (MOD // i) % MOD
        ans *= (n + 1 - i) * iinv[i] % MOD
        ans %= MOD
    return ans


S = int(eval(input()))
ans = 0
for i in range(1, S + 1):
    tmp = S
    tmp -= i * 3
    if tmp < 0:
        continue
    ans += comb(i + tmp - 1, tmp)
    ans %= MOD
print(ans)

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

- - -def comb(n, k): -    if n < k or n < 0 or k < 0: -        return 0 -    if k == 0: -        return 1 -    iinv = [1] * (k + 1) -    ans = n -    for i in range(2, k + 1): -        iinv[i] = MOD - iinv[MOD % i] * (MOD // i) % MOD -        ans *= (n + 1 - i) * iinv[i] % MOD -        ans %= MOD -    return ans - - -ans = 0 -for i in range(1, S + 1): -    tmp = S -    tmp -= i * 3 -    if tmp < 0: -        continue -    ans += comb(i + tmp - 1, tmp) -    ans %= MOD -print(ans) +dp = [0] * (S + 4) +dp[0] = 1 +dp[3] = 1 +for i in range(4, S + 1): +    for k in range(i - 2): +        dp[i] += dp[k] +print((dp[S] % MOD))