import sys

from functools import lru_cache

s = int(eval(input()))

sys.setrecursionlimit(10000000)





@lru_cache(maxsize=10000000)

def f(n):

    mod = 10**9 + 7

    if n == 3:

        return 1

    if n == 0:

        return 1

    if 0 < n < 3:

        return 0

    ret = 0

    for u in range(3, n+1):

        ret += f(n - u)

        ret %= mod

    return ret





print((f(s)))

class ModCalc:

    mod = 10**9 + 7



    def __init__(self, n):

        self.n = n

        self.inv = [1] * (self.n + 1)

        self.fac = [1] * (self.n + 1)

        self.finv = [1] * (self.n + 1)

        self.inv[0] = 0

        self.inv_table()



    def inv_table(self):

        for i in range(2, self.n+1):

            self.inv[i] = self.inv[self.mod % i] * (self.mod - self.mod // i) % self.mod

            self.fac[i] = self.fac[i-1] * i % self.mod

            self.finv[i] = self.finv[i-1] * self.inv[i] % self.mod



    def comb(self, n, r):

        if n < r:

            return 0

        if n < 0 or r < 0:

            return 0



        return self.fac[n] * self.finv[r] % self.mod * self.finv[n-r] % self.mod



    def perm(self, n, r):

        if n < r:

            return 0

        if n < 0 or r < 0:

            return 0



        return self.fac[n] * self.finv[n-r] % self.mod



    def fact(self, n):

        return self.fac[n]





s = int(eval(input()))

mc = ModCalc(s+6)

mod = 10**9 + 7

y = s//3



ans = 0

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

    x = mc.comb(s - i * 3 + i - 1, i-1)

    ans += x

    ans %= mod



print(ans)
import sys
from functools import lru_cache

s = int(eval(input()))
sys.setrecursionlimit(10000000)


@lru_cache(maxsize=10000000)
def f(n):
    mod = 10**9 + 7
    if n == 3:
        return 1
    if n == 0:
        return 1
    if 0 < n < 3:
        return 0
    ret = 0
    for u in range(3, n + 1):
        ret += f(n - u)
        ret %= mod
    return ret


print((f(s)))

class ModCalc:
    mod = 10**9 + 7

    def __init__(self, n):
        self.n = n
        self.inv = [1] * (self.n + 1)
        self.fac = [1] * (self.n + 1)
        self.finv = [1] * (self.n + 1)
        self.inv[0] = 0
        self.inv_table()

    def inv_table(self):
        for i in range(2, self.n + 1):
            self.inv[i] = self.inv[self.mod % i] * (self.mod - self.mod // i) % self.mod
            self.fac[i] = self.fac[i - 1] * i % self.mod
            self.finv[i] = self.finv[i - 1] * self.inv[i] % self.mod

    def comb(self, n, r):
        if n < r:
            return 0
        if n < 0 or r < 0:
            return 0
        return self.fac[n] * self.finv[r] % self.mod * self.finv[n - r] % self.mod

    def perm(self, n, r):
        if n < r:
            return 0
        if n < 0 or r < 0:
            return 0
        return self.fac[n] * self.finv[n - r] % self.mod

    def fact(self, n):
        return self.fac[n]


s = int(eval(input()))
mc = ModCalc(s + 6)
mod = 10**9 + 7
y = s // 3
ans = 0
for i in range(1, y + 1):
    x = mc.comb(s - i * 3 + i - 1, i - 1)
    ans += x
    ans %= mod
print(ans)

-import sys -from functools import lru_cache +class ModCalc: +    mod = 10**9 + 7 + +    def __init__(self, n): +        self.n = n +        self.inv = [1] * (self.n + 1) +        self.fac = [1] * (self.n + 1) +        self.finv = [1] * (self.n + 1) +        self.inv[0] = 0 +        self.inv_table() + +    def inv_table(self): +        for i in range(2, self.n + 1): +            self.inv[i] = self.inv[self.mod % i] * (self.mod - self.mod // i) % self.mod +            self.fac[i] = self.fac[i - 1] * i % self.mod +            self.finv[i] = self.finv[i - 1] * self.inv[i] % self.mod + +    def comb(self, n, r): +        if n < r: +            return 0 +        if n < 0 or r < 0: +            return 0 +        return self.fac[n] * self.finv[r] % self.mod * self.finv[n - r] % self.mod + +    def perm(self, n, r): +        if n < r: +            return 0 +        if n < 0 or r < 0: +            return 0 +        return self.fac[n] * self.finv[n - r] % self.mod + +    def fact(self, n): +        return self.fac[n] + -sys.setrecursionlimit(10000000) - - -@lru_cache(maxsize=10000000) -def f(n): -    mod = 10**9 + 7 -    if n == 3: -        return 1 -    if n == 0: -        return 1 -    if 0 < n < 3: -        return 0 -    ret = 0 -    for u in range(3, n + 1): -        ret += f(n - u) -        ret %= mod -    return ret - - -print((f(s))) +mc = ModCalc(s + 6) +mod = 10**9 + 7 +y = s // 3 +ans = 0 +for i in range(1, y + 1): +    x = mc.comb(s - i * 3 + i - 1, i - 1) +    ans += x +    ans %= mod +print(ans)