def main():

    MOD = 10 ** 9 + 7



    S = int(eval(input()))

    dp = [0] * (S + 1)

    dp[0] = 1



    for x in range(3, S + 1):

        # dp[x-3] + dp[x-4] + dp[x-5] + ... + dp[0]

        # dp[x-3] + dp[x-1]

        dp[x] = (dp[x - 3] + dp[x - 1]) % MOD



    print((dp[S]))





if __name__ == '__main__':

    main()

def main():

    MOD = 10 ** 9 + 7



    S = int(eval(input()))

    dp = [0] * (S + 1)

    dp[0] = 1



    acc = 0

    for x in range(3, S + 1):

        dp[x] = (acc := (acc + dp[x - 3]) % MOD)



    print((dp[S]))





if __name__ == '__main__':

    main()

def main():
    MOD = 10**9 + 7
    S = int(eval(input()))
    dp = [0] * (S + 1)
    dp[0] = 1
    for x in range(3, S + 1):
        # dp[x-3] + dp[x-4] + dp[x-5] + ... + dp[0]
        # dp[x-3] + dp[x-1]
        dp[x] = (dp[x - 3] + dp[x - 1]) % MOD
    print((dp[S]))


if __name__ == "__main__":
    main()

def main():
    MOD = 10**9 + 7
    S = int(eval(input()))
    dp = [0] * (S + 1)
    dp[0] = 1
    acc = 0
    for x in range(3, S + 1):
        dp[x] = (acc := (acc + dp[x - 3]) % MOD)
    print((dp[S]))


if __name__ == "__main__":
    main()

+    acc = 0 -        # dp[x-3] + dp[x-4] + dp[x-5] + ... + dp[0] -        # dp[x-3] + dp[x-1] -        dp[x] = (dp[x - 3] + dp[x - 1]) % MOD +        dp[x] = (acc := (acc + dp[x - 3]) % MOD)