#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int i,j,dp[4001]={0},s;
	scanf("%d",&s);
	dp[0]=1;
	for(i=0;i<s;i++){
		if(dp[i]!=0){
			for(j=3;j<=s;j++){
				if(i+j<=s){
					dp[i+j]=dp[i]+dp[i+j];
					dp[i+j]=dp[i+j]%1000000007;
				}
			}
		}
	}
	printf("%d\n",dp[s]);
	return 0;
}