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

int main(){
  int s;
  cin>>s;
  vector<long long> dp(s+1,0);
  long long max = pow(10,9)+7;
  
  dp[0] = 1;
  for(int i=3;i<=s;i++){
    dp[i] = (dp[i-1]+dp[i-3])%max;
  }
  cout<<dp[s]<<endl;
  return 0;
}
