#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7;

int main() {
    int S; cin>>S;
    vector<ll> A(S+1,0);
    A[0] = 1;
    for(int i=3; i<=S; ++i) {
      A[i] = (A[i-1]+A[i-3])%MOD;
    }
    cout << A[S] << endl;
}
