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

const int MOD = 1e9 + 7;
 
int main() {
 
 int n;
  cin >> n;
  vector<int> dp(n + 1, 0);
  
  dp[0] = 1;
  
  for(int s = 3; s <= n; ++s) {
	for(int i = 3; s - i >= 0; ++i) {
		dp[s] += dp[s-i];
      	dp[s] %= MOD;
    }
  }
  
  cout << dp[n] << '\n';
  return 0;
}