import sys input = sys.stdin.readline sys.setrecursionlimit(10**7) N=int(input()) mod=10**9+7 from functools import lru_cache @lru_cache(maxsize=None) def calc(rest,x): if rest==0: return 1 if x>rest: return 0 ANS=0 for i in range(rest//x+1): ANS+=calc(rest-i*x,x+1) ANS%=mod return ANS print(calc(N,3))