#include <iostream>
#include <vector>
int main(){
	long long s, mod = 1e9+7;
	std::cin >> s;
	std::vector<long long> dp(s+1);
	dp[0] = 1;
	for(int i = 3; i <= s; i++)
		for(int j = 0; j <= i-3; j++) dp[i] = (dp[i]+dp[j])%mod;
	std::cout << dp[s] << '\n';
	return 0;
}

