def main():

    s = int(eval(input()))

    mod = 10**9+7

    dp = [0] * (s+1)

    dp[0] = 1

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

        for j in range(0, (i-3)+1):

            dp[i] += dp[j]

            dp[i] %= mod

    print((dp[s]))



if __name__ == "__main__":

    main()

def main():

    s = int(eval(input()))

    mod = 10**9+7

    dp = [0] * (s+1)

    dp[0] = 1

    x = 0

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

        if i-3 >= 0:

            x += dp[i-3]

            x %= mod

        dp[i] = x

    print((dp[s]))



if __name__ == "__main__":

    main()

def main():
    s = int(eval(input()))
    mod = 10**9 + 7
    dp = [0] * (s + 1)
    dp[0] = 1
    for i in range(1, s + 1):
        for j in range(0, (i - 3) + 1):
            dp[i] += dp[j]
            dp[i] %= mod
    print((dp[s]))


if __name__ == "__main__":
    main()

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


if __name__ == "__main__":
    main()

+    x = 0 -        for j in range(0, (i - 3) + 1): -            dp[i] += dp[j] -            dp[i] %= mod +        if i - 3 >= 0: +            x += dp[i - 3] +            x %= mod +        dp[i] = x