#include<bits/stdc++.h>
using namespace std;
 
#define REP(i,n) for(int i = 0;i < n;i++)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()

template<class T> bool chmax(T& a,T b){ if(a < b){ a = b; return true; }else return false; }
template<class T> bool chmin(T& a,T b){ if(a > b){ a = b; return true; }else return false; }
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;
using vpi = vector<Pi>;
using vpl = vector<Pl>;
 
void lyn(){
  cin.tie(0);
  ios::sync_with_stdio(false);
}
 
#define debug(arr) cout << #arr << " = " << arr << '\n'
#define debug2(a,b) cout << "[" << #a << "," << #b << "] = " << "[" << a << "," << b << "]" << '\n'
template<class T> ostream &operator << (ostream& out, const vector<T>& arr) {
	cout << "{"; for (int i = 0; i < arr.size(); i++)cout << (!i ? "" : ", ") << arr[i]; cout << "}";
	return out;
}
template<class T> ostream &operator << (ostream& out, const vector<vector<T> >& arr) {
	cout << "{\n"; for (auto& vec : arr)cout << "  " << vec << ",\n"; cout << "}";
	return out;
}
template<class S,class T> ostream &operator << (ostream& out, const pair<S,T>& p){
  cout << "{" << p.first << "," << p.second << "}" << '\n';
  return out;
}
template<class T> istream &operator >> (istream& in, vector<T>& arr) {
	for (auto& i : arr)cin >> i; return in;
}
#define MOD 1000000000 + 7
template<int mod>
struct Modint {
  long long x; // typedef long long ll;
  Modint(long long x=0):x((x%mod+mod)%mod){}
  Modint& operator+=(const Modint a) { if((x+=a.x)>=mod)x-=mod;return *this;}
  Modint& operator-=(const Modint a) { if((x+=mod-a.x)>=mod)x-=mod; return *this;}
  Modint& operator*=(const Modint a) { (x *=a.x)%=mod; return *this;}
  Modint operator+(const Modint a) const { Modint res(*this);return res+=a;}
  Modint operator-(const Modint a) const { Modint res(*this);return res-=a;}
  Modint operator*(const Modint a) const { Modint res(*this);return res*=a;}
  Modint pow(ll t) const {
    if (!t) return 1;Modint a = pow(t>>1);a*=a;
    if (t&1) a *= *this;return a;
  }
  // for prime mod
  Modint inv() const { return pow(mod-2);}
  Modint& operator/=(const Modint a) { return (*this) *= a.inv();}
};
using mint = Modint<MOD>;
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
template<int mod = 1000000007, int maxn = 1000000>
struct modcomb {
    using mint = Modint<mod>;
    vector<mint> f, finv;
    modcomb() {
        f.assign(maxn, 0);
        finv.assign(maxn, 0);
        for (int i = 0; i < maxn; i++) {
            if (!i) f[i] = (mint) 1;
            else f[i] = f[i - 1] * (mint) i;
        }
        finv[maxn - 1] = f[maxn - 1].inv();
        for (int i = maxn - 2; i >= 0; i--) {
            finv[i] = finv[i + 1] * (mint) (i + 1);
        }
    }
    mint comb(int n, int r) {
        if (n < 0 || r < 0 || n < r) return 0;
        else { return f[n] * finv[r] * finv[n - r]; }
    }
};
modcomb C;
int main(void){
  cin.tie(0);
  ios::sync_with_stdio(false);
  //cout << fixed << setprecision(20);
  
  mint ans = 0;
  ll n;cin >> n;
  for(int i = 1;i <= n;i++){
    ll m = n - 3*i;
    if(m < 0) continue;
    ans += C.comb(m + i - 1,m);
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 18640