#include <bits/stdc++.h>
using namespace std;

int E=1000000007;
int main() {
   int S;
   cin >> S;
   int dp[S+1];
   for (int i=0; i<S+1; i++) dp[i]=0;
   dp[0]=1;
   for (int i=3; i<S+1; i++) {
       for (int j=3; j<i+1; j++) {
           dp[i]+=dp[i-j];
           dp[i]%=E;
       }
   }
   cout << dp[S] << endl;
}