# -*- coding: utf-8 -*-

import sys





def main():

    S = int( sys.stdin.readline() )



    dp = [0]*(S+1)

    dp[0] = 1

    mod = 10**9 + 7



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

        cnt = 0



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

            cnt += dp[i-j]

            cnt %= mod

        

        dp[i] = cnt





    print((dp[-1]))





if __name__ == "__main__":

    main()

# -*- coding: utf-8 -*-

import sys





def main():

    S = int( sys.stdin.readline() )



    dp = [0]*(S+1)

    dp[0] = 1

    mod = 10**9 + 7



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

        dp[i] = dp[i-3] + dp[i-1]

        dp[i] %= mod

    



    print((dp[-1]))





if __name__ == "__main__":

    main()

# -*- coding: utf-8 -*-
import sys


def main():
    S = int(sys.stdin.readline())
    dp = [0] * (S + 1)
    dp[0] = 1
    mod = 10**9 + 7
    for i in range(3, S + 1):
        cnt = 0
        for j in range(3, i + 1):
            cnt += dp[i - j]
            cnt %= mod
        dp[i] = cnt
    print((dp[-1]))


if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-
import sys


def main():
    S = int(sys.stdin.readline())
    dp = [0] * (S + 1)
    dp[0] = 1
    mod = 10**9 + 7
    for i in range(3, S + 1):
        dp[i] = dp[i - 3] + dp[i - 1]
        dp[i] %= mod
    print((dp[-1]))


if __name__ == "__main__":
    main()

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