

def resolve():

    MOD = 10 ** 9 + 7

    N = int(eval(input()))



    dp = [0] * (N + 1)

    dp[0] = 1

    for n in range(N + 1):

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

            dp[n] += dp[n - i]

            dp[n] %= MOD



    print((dp[N]))





if __name__ == "__main__":

    resolve()


def resolve():

    MOD = 10 ** 9 + 7

    N = int(eval(input()))



    dp = [0] * (N + 1)

    res = 1

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

        res += dp[i - 3]

        res %= MOD

        dp[i] = res



    print((dp[N]))





if __name__ == "__main__":

    resolve()
def resolve():
    MOD = 10**9 + 7
    N = int(eval(input()))
    dp = [0] * (N + 1)
    dp[0] = 1
    for n in range(N + 1):
        for i in range(3, N + 1):
            dp[n] += dp[n - i]
            dp[n] %= MOD
    print((dp[N]))


if __name__ == "__main__":
    resolve()

def resolve():
    MOD = 10**9 + 7
    N = int(eval(input()))
    dp = [0] * (N + 1)
    res = 1
    for i in range(3, N + 1):
        res += dp[i - 3]
        res %= MOD
        dp[i] = res
    print((dp[N]))


if __name__ == "__main__":
    resolve()

-    dp[0] = 1 -    for n in range(N + 1): -        for i in range(3, N + 1): -            dp[n] += dp[n - i] -            dp[n] %= MOD +    res = 1 +    for i in range(3, N + 1): +        res += dp[i - 3] +        res %= MOD +        dp[i] = res