#include <iostream>

using namespace std;
int dp[2005] = {0,0,0,1,1};
int main()
{
    int s;
    cin>>s;
    if(s>4)
    {
        for(int i = 5;i<=s;i++)
        {
            dp[i] = (dp[i-3]+dp[i-1])%1000000007;
        }
    }
    cout<<dp[s]<<endl;
    return 0;
}
