#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int S;cin>>S;vector<long long>D(S+6);
  D[0]=0;D[1]=0;D[2]=1;D[3]=1;D[4]=1;
  for(int X=5;X<S;X++){
    D[X]=(D[X-3]+D[X-1])%1000000007;
  }
  cout<<D[S-1]<<endl;
}