from math import factorial



s = int(eval(input()))

mod = pow(10, 9) + 7





def nCr(n, r):

    return int(factorial(n) // factorial(r) // factorial (n - r) % mod)



ans = 0

seq_len = s // 3



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

    ans += nCr(s - 3 * i + (i - 1), i - 1)



print((ans % mod))
# 動的計画法による解法



s = int(eval(input()))

mod = pow(10, 9) + 7



A = [0] * (s + 1)



if s >= 3:

    A[3] = 1



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

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



print((A[s]))
from math import factorial

s = int(eval(input()))
mod = pow(10, 9) + 7


def nCr(n, r):
    return int(factorial(n) // factorial(r) // factorial(n - r) % mod)


ans = 0
seq_len = s // 3
for i in range(1, seq_len + 1):
    ans += nCr(s - 3 * i + (i - 1), i - 1)
print((ans % mod))

# 動的計画法による解法
s = int(eval(input()))
mod = pow(10, 9) + 7
A = [0] * (s + 1)
if s >= 3:
    A[3] = 1
for i in range(4, s + 1):
    A[i] = (A[i - 3] + A[i - 1]) % mod
print((A[s]))

-from math import factorial - +# 動的計画法による解法 - - -def nCr(n, r): -    return int(factorial(n) // factorial(r) // factorial(n - r) % mod) - - -ans = 0 -seq_len = s // 3 -for i in range(1, seq_len + 1): -    ans += nCr(s - 3 * i + (i - 1), i - 1) -print((ans % mod)) +A = [0] * (s + 1) +if s >= 3: +    A[3] = 1 +for i in range(4, s + 1): +    A[i] = (A[i - 3] + A[i - 1]) % mod +print((A[s]))