#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }
template<class T>
ostream &operator<<(ostream &os,const vector<T> &v){
  for(int i = 0;i < v.size();i++) os << (i ? "," : "[") << v[i];
  os << "]";
  return os;
}

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }

const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

template<long long mod = 1000000007>
struct modint{
  long long a;

  modint() : a(0){}
  modint(long long t){
    a = t % mod;
    if(a < 0) a += mod;
  }

  operator long long() const{ return a; }

  bool operator==(const modint &x) const{ return a == x.a; }
  bool operator!=(const modint &x) const{ return a != x.a; }

  modint operator-() const{ return modint(a ? (mod - a) : 0); }
  modint operator~() const{ return pow(mod - 2); }

  modint inverse() const { // 拡張ユークリッド互除法
    int aa = a, b = mod, u = 1, v = 0, t;
    while(b > 0) {
      t = aa / b;
      swap(aa -= t * b, b);
      swap(u -= t * v, v);
    }
    return modint(u);
  }
  
  modint operator+(const modint &x) const{ return modint(*this) += x; }
  modint operator-(const modint &x) const{ return modint(*this) -= x; }
  modint operator*(const modint &x) const{ return modint(*this) *= x; }
  modint operator/(const modint &x) const{ return modint(*this) /= x; }

  modint &operator+=(const modint &x){
    a += x.a;
    if(a >= mod) a -= mod;
    return *this;
  }
  modint &operator-=(const modint &x){
    a -= x.a;
    if(a < 0) a += mod;
    return *this;
  }
  modint &operator*=(const modint &x){
    a = a * x.a % mod;
    return *this;
  }
  modint &operator/=(const modint &x){
    a = a * (~x).a % mod; 
    return *this;
  }

  friend ostream &operator<<(ostream &os,const modint &x){
    return os << x.a;
  }
  friend istream &operator>>(istream &is,modint &x){
    long long t;
    is >> t;
    x = modint(t);
    return is;
  }

  modint pow(long long x) const{
    modint ret = 1,tmp = a;
    for(;x;tmp *= tmp,x >>= 1){
      if(x & 1) ret *= tmp;
    }
    return ret;
  }
};

template<class T>
struct Combination{
  vector<T> fact,factinv;
  Combination(int n) : fact(n + 1),factinv(n + 1){
    fact[0] = 1;
    for(int i = 1;i <= n;i++) fact[i] = fact[i - 1] * T(i);
    factinv[n] = ~fact[n];
    for(int i = n;i >= 1;i--) factinv[i - 1] = factinv[i] * T(i);
  }
  T nCr(int n,int r){
    if(r < 0 || n < r) return 0;
    return fact[n] * factinv[r] * factinv[n - r];
  }
};

signed main(){
  int s;
  cin >> s;
  if( s < 3 ){
    cout << "0\n";
  } else {
    modint<MOD> ans = 0;
    Combination<modint<MOD>> comb(4100);
    int d3 = s / 3;
    
    for(int i=1;i<=d3;i++){
      int s2 = s - i * 3;
      if( s2 == 0 ){
        ans += 1;
      } else {
        ans += comb.nCr(s2+i-1,s2);
      }
    }
    cout << ans << endl;
  }
  
}



Measured memory_bytes: 3688