#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
	ll s,mod=pow(10,9)+7;
	cin>>s;
	vector<int> dp(s+1,0);
	dp[0]=1;
	for(int i=3;i<=s;i++){
		for(int j=3;(i-j)>=0;j++){
			dp[i]=(dp[i]%mod+dp[i-j]%mod)%mod;
		}
// 		cout<<dp[i]<<" ";
	}
// 	cout<<endl;
	cout<<dp[s]<<endl;
}