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

int main() {
  int s;
  cin >> s;
  
  vector<long long> ans(s+1);
  ans.at(0) = 1;
  long long cnt = 0, mod = pow(10, 9) + 7;
  for(int i = 3; i <= s; i++){
    cnt += ans.at(i-3);
    cnt %= mod;
    ans.at(i) = cnt;
  }
  
  cout << ans.at(s) << endl;
}