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

/*
ll gcds(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    ll r=a%b;
    if(r==0){
        return b;
    }
    while(r>0){
        r=a%b;
        a=b;
        b=r;
    }
    return a;
}

ll lcms(ll a,ll b){
    ll mmr=gcds(a,b);
    a=a/mmr;
    b=b/mmr;
    return a*b*mmr;
}
*/
/*
struct UnionFind{
    vector<int> par;
    vector<int> rank;
    vector<int> size;

    //こいつがいわゆるコンストラクタ
    //初期化している
    UnionFind(int N) : par(N),rank(N),size(N){
        for(int i=0;i<N;i++){
            par[i]=i;
            size[i]=1;
            rank[i]=0;
        }
    }

    int find(int x){
        if(x == par[x]) return x;
        return par[x] = find(par[x]);
    }

    void unite(int x, int y){
        int rx,ry;
        rx = find(x);
        ry = find(y);
        if(rx == ry){
            return;
        }
        else{
            if(rank[rx]<rank[ry]){
                par[rx]=ry;
                size[ry]+=size[rx];
            }
            else{
                par[ry]=rx;
                size[rx]+=size[ry];
                if(rank[rx]==rank[ry]){
                    rank[rx]++;
                }
            }
        }
    }

    bool same(int x,int y){
        return find(x) == find(y);
    }
};
*/
ll inf = 1000000000 + 7;
int main() {
  ll S;
  cin >> S;
  vector<ll> A(S, 0);
  vector<ll> B(S, 0);
  A.at(2) = 1;
  B.at(2) = 1;
  for (ll i = 3; i < S; i++) {
    A.at(i) = B.at(i - 3) + 1;
    B.at(i) = A.at(i) + B.at(i - 1);
    A.at(i) = A.at(i) % inf;
    B.at(i) = B.at(i) % inf;
  }
  cout << A.at(S - 1) << endl;
}

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

/*
ll gcds(ll a,ll b){
    if(a<b){
        swap(a,b);
    }
    ll r=a%b;
    if(r==0){
        return b;
    }
    while(r>0){
        r=a%b;
        a=b;
        b=r;
    }
    return a;
}

ll lcms(ll a,ll b){
    ll mmr=gcds(a,b);
    a=a/mmr;
    b=b/mmr;
    return a*b*mmr;
}
*/
/*
struct UnionFind{
    vector<int> par;
    vector<int> rank;
    vector<int> size;

    //こいつがいわゆるコンストラクタ
    //初期化している
    UnionFind(int N) : par(N),rank(N),size(N){
        for(int i=0;i<N;i++){
            par[i]=i;
            size[i]=1;
            rank[i]=0;
        }
    }

    int find(int x){
        if(x == par[x]) return x;
        return par[x] = find(par[x]);
    }

    void unite(int x, int y){
        int rx,ry;
        rx = find(x);
        ry = find(y);
        if(rx == ry){
            return;
        }
        else{
            if(rank[rx]<rank[ry]){
                par[rx]=ry;
                size[ry]+=size[rx];
            }
            else{
                par[ry]=rx;
                size[rx]+=size[ry];
                if(rank[rx]==rank[ry]){
                    rank[rx]++;
                }
            }
        }
    }

    bool same(int x,int y){
        return find(x) == find(y);
    }
};
*/
ll inf = 1000000000 + 7;
int main() {
  ll S;
  cin >> S;
  vector<ll> A(S, 0);
  vector<ll> B(S, 0);
  if (S > 2) {
    A.at(2) = 1;
    B.at(2) = 1;
  }
  if (S > 3) {
    for (ll i = 3; i < S; i++) {
      A.at(i) = B.at(i - 3) + 1;
      B.at(i) = A.at(i) + B.at(i - 1);
      A.at(i) = A.at(i) % inf;
      B.at(i) = B.at(i) % inf;
    }
  }
  cout << A.at(S - 1) << endl;
}


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

#define prec(n) fixed << setprecision(n)
#define optimize                                                               \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);
#define PI acos(-1.0)
#define RESET(a, b) memset(a, b, sizeof(a))
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vv vector<int>
#define ff first
#define ss second
#define sz(v) v.size()
#define all(v) v.begin(), v.end()

int const MOD = (int)1e9 + 7;
inline void normal(ll &a) {
  a %= MOD;
  (a < 0) && (a += MOD);
}
inline ll modMul(ll a, ll b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a * b) % MOD;
}
inline ll modAdd(ll a, ll b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a + b) % MOD;
}
inline ll modSub(ll a, ll b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline ll modPow(ll b, ll p) {
  ll r = 1;
  while (p) {
    if (p & 1)
      r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1;
  }
  return r;
}
inline ll modInverse(ll a) { return modPow(a, MOD - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
inline ll mod(ll a, ll m) {
  if (a < 0)
    return m - (abs(a) % m);
  else if (a < m)
    return a;
  else
    return (a % m);
}
const int N = 200007;
const int MAX = 1000005;
vector<int> fact;

int main() {
  optimize ll s, n, ans = 0;
  cin >> s;
  if (s < 3) {
    cout << 0 << endl;
    return 0;
  }
  n = s;
  int x = 0;
  while (n - 3 >= 3) {
    n -= 3;
    x++;
  }
  fact.resize(s + 1);
  fact[0] = 1;
  for (int i = 1; i <= s + 1; i++)
    fact[i] = modMul(fact[i - 1], i);
  for (int i = 1; i <= x + 1; i++) {
    ll N = s - i * 3;
    ll tmp = modDiv(fact[i + N - 1], modMul(fact[N], fact[i - 1]));
    ans = modAdd(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}

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

#define prec(n) fixed << setprecision(n)
#define optimize                                                               \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);
#define PI acos(-1.0)
#define RESET(a, b) memset(a, b, sizeof(a))
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vv vector<int>
#define ff first
#define ss second
#define sz(v) v.size()
#define all(v) v.begin(), v.end()

int const MOD = (int)1e9 + 7;
inline void normal(ll &a) {
  a %= MOD;
  (a < 0) && (a += MOD);
}
inline ll modMul(ll a, ll b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a * b) % MOD;
}
inline ll modAdd(ll a, ll b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  return (a + b) % MOD;
}
inline ll modSub(ll a, ll b) {
  a %= MOD, b %= MOD;
  normal(a), normal(b);
  a -= b;
  normal(a);
  return a;
}
inline ll modPow(ll b, ll p) {
  ll r = 1;
  while (p) {
    if (p & 1)
      r = modMul(r, b);
    b = modMul(b, b);
    p >>= 1;
  }
  return r;
}
inline ll modInverse(ll a) { return modPow(a, MOD - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }
inline ll mod(ll a, ll m) {
  if (a < 0)
    return m - (abs(a) % m);
  else if (a < m)
    return a;
  else
    return (a % m);
}
const int N = 200007;
const int MAX = 1000005;
int fact[20001];
int main() {
  optimize ll s, n, ans = 0;
  cin >> s;
  if (s < 3) {
    cout << 0 << endl;
    return 0;
  }
  n = s;
  int x = 0;
  while (n - 3 >= 3) {
    n -= 3;
    x++;
  }
  fact[0] = 1;
  for (int i = 1; i <= 2000; i++)
    fact[i] = modMul(fact[i - 1], i);
  for (int i = 1; i <= x + 1; i++) {
    ll N = s - i * 3;
    ll tmp = modDiv(fact[i + N - 1], modMul(fact[N], fact[i - 1]));
    ans = modAdd(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}


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

long calc(long n, vector<long> &dp, long mod) {
  if (n < 3)
    return 0;
  if (dp[n] != 0)
    return dp[n];
  for (int i = 3; i <= n; i++) {

    if (n != i)
      dp[n] += calc(n - i, dp, mod);
    else
      dp[n]++;
    dp[n] %= mod;
  }
  dp[n] %= mod;

  return dp[n];
}

int main() {
  long s;
  cin >> s;
  long const mod = 1e9 + 7;
  vector<long> dp(s + 1);
  dp[3] = 1;

  cout << calc(s, dp, mod) << endl;
}

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

long calc(long n, vector<long> &dp, long mod) {
  if (n < 3)
    return 0;
  if (dp[n] != 0)
    return dp[n];
  for (int i = 3; i <= n; i++) {

    if (n != i)
      dp[n] += calc(n - i, dp, mod);
    else
      dp[n]++;
    dp[n] %= mod;
  }
  dp[n] %= mod;

  return dp[n];
}

int main() {
  long s;
  cin >> s;
  long const mod = 1e9 + 7;
  vector<long> dp(s + 1);
  if (s >= 3)
    dp[3] = 1;

  cout << calc(s, dp, mod) << endl;
}


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

int main() {
  ll s = 0;
  cin >> s;
  vector<ll> dp(s + 1, 0);
  dp[3] = 1;
  for (int i = 4; i <= s; i++)
    dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007;
  cout << dp[s] << endl;
  return 0;
}

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

int main() {
  ll s = 0;
  cin >> s;
  vector<ll> dp(2001, 0);
  dp[3] = 1;
  for (int i = 4; i <= s; i++)
    dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007;
  cout << dp[s] << endl;
  return 0;
}


#include <bits/stdc++.h>
#define repl(i, l, r) for (int i = l; i < r; ++i)
#define rep(i, n) repl(i, 0, n)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define chmax(x, y) x = max(x, y)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using G = vector<vector<int>>;
const int MOD = 1000000007;
const int INF = 1001001001;
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, -1, 0, 1};

struct mint {
  ll x;
  mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= MOD)
      x -= MOD;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += MOD - a.x) >= MOD)
      x -= MOD;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  mint inv() const { return pow(MOD - 2); }
  mint &operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

mint comb(int n, int r) {
  vector<vector<mint>> v(n + 1, vector<mint>(n + 1, 0));
  for (int i = 0; i < v.size(); i += 1) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j += 1) {
    for (int k = 1; k < j; k += 1) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v[n][r];
}

int main() {
  ll s;
  cin >> s;
  ll maxlen = s / 3;
  mint ans = 0;
  for (ll i = maxlen; i > 0; --i) {
    ll rest = s - 3 * i;
    mint x = comb(rest + i - 1, rest);
    ans += x;
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#define repl(i, l, r) for (int i = l; i < r; ++i)
#define rep(i, n) repl(i, 0, n)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define chmax(x, y) x = max(x, y)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using G = vector<vector<int>>;
const int MOD = 1000000007;
const int INF = 1001001001;
const int dy[] = {-1, 0, 1, 0};
const int dx[] = {0, -1, 0, 1};

struct mint {
  ll x;
  mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= MOD)
      x -= MOD;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += MOD - a.x) >= MOD)
      x -= MOD;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  mint inv() const { return pow(MOD - 2); }
  mint &operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
mint COM(int n, int k) {
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
  int s;
  cin >> s;
  int maxlen = s / 3;
  mint ans = 0;
  COMinit();
  for (int i = maxlen; i > 0; --i) {
    int rest = s - 3 * i;
    mint x = COM(rest + i - 1, rest);
    ans += x;
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
  int mod = 1e9 + 7;
  int n;
  cin >> n;
  long long int dp[n + 1];
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  dp[6] = 2;
  for (int i = 7; i <= n; i++)
    dp[i] = (dp[i - 3] * 2 + dp[i - 4] + dp[i - 5]) % mod;
  cout << dp[n];
  return 0;
}

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

int main() {
  int mod = 1e9 + 7;
  int n;
  cin >> n;
  long long int dp[n + 7];
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  dp[6] = 2;
  for (int i = 7; i <= n; i++)
    dp[i] = (dp[i - 3] * 2 + dp[i - 4] + dp[i - 5]) % mod;
  cout << dp[n];
  return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define speed                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define pb push_back
#define mem1(a) memset(a, -1, sizeof(a))
#define mem0(a) memset(a, 0, sizeof(a))
#define endl "\\n"
#define mod 1000000007
#define mod1 998244353
#define ff first
#define ss second
#define MAX 500005
#define N 200005
#define INF 1000000009
#define all(v) v.begin(), v.end()
#define sbit(a) __builtin_popcount(a)
template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef pair<ll, ll> pll;
typedef pair<pll, ll> ppl;
typedef map<ll, ll> mpll;
typedef map<vector<ll>, ll> mpvl;
ll power(ll x, ll y, ll p) {
  ll res = 1;

  x = x % p;

  if (x == 0)
    return 0;
  while (y > 0) {

    if (y & 1)
      res = (res * x) % p;

    y = y >> 1;
    x = (x * x) % p;
  }

  return res;
}
int l[2005][2005] = {0};

int initialize() {

  // 0C0 = 1
  l[0][0] = 1;
  for (int i = 1; i < 2005; i++) {
    // Set every nCr = 1 where r = 0
    l[i][0] = 1;
    for (int j = 1; j < i + 1; j++) {

      // Value for the current cell of Pascal's triangle
      l[i][j] = (l[i - 1][j - 1] % mod + l[i - 1][j] % mod) % mod;
    }
  }
}

// Function to return the value of nCr
int nCr(int n, int r) {
  // Return nCr
  return (l[n][r]);
}

void solve() {
  ll s;
  cin >> s;
  if (s == 1 || s == 2) {
    cout << 0 << endl;
    return;
  }
  ll ans = 0;
  for (ll i = 1; i <= s; i++) {
    if (s - i * 3 >= 0) {

      ans += l[s - 3 * i + i - 1][s - 3 * i];
      // cout<<l[4][4]<<endl;
      ans %= mod;
      // cout<<ans<<endl;
    }
  }
  cout << ans << endl;
}

int main() {
  speed;
  initialize();
  ll kk;
  kk = 1;
  // cin >> kk;
  while (kk--) {
    solve();
  }
  return 0;
}

#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define speed                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define ll long long
#define pb push_back
#define mem1(a) memset(a, -1, sizeof(a))
#define mem0(a) memset(a, 0, sizeof(a))
#define endl "\\n"
#define mod 1000000007
#define mod1 998244353
#define ff first
#define ss second
#define MAX 500005
#define N 200005
#define INF 1000000009
#define all(v) v.begin(), v.end()
#define sbit(a) __builtin_popcount(a)
template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef pair<ll, ll> pll;
typedef pair<pll, ll> ppl;
typedef map<ll, ll> mpll;
typedef map<vector<ll>, ll> mpvl;
ll power(ll x, ll y, ll p) {
  ll res = 1;

  x = x % p;

  if (x == 0)
    return 0;
  while (y > 0) {

    if (y & 1)
      res = (res * x) % p;

    y = y >> 1;
    x = (x * x) % p;
  }

  return res;
}
ll l[2005][2005] = {0};

void initialize() {

  // 0C0 = 1
  l[0][0] = 1;
  for (ll i = 1; i < 2002; i++) {
    // Set every nCr = 1 where r = 0
    l[i][0] = 1;
    for (ll j = 1; j < i + 1; j++) {

      // Value for the current cell of Pascal's triangle
      l[i][j] = (l[i - 1][j - 1] % mod + l[i - 1][j] % mod) % mod;
    }
  }
}

void solve() {
  ll s;
  cin >> s;
  if (s == 1 || s == 2) {
    cout << 0 << endl;
    return;
  }
  ll ans = 0;
  // cout<<l[2000][20]<<endl;
  for (ll i = 1; i <= s; i++) {
    if (s - i * 3 >= 0) {

      ans += l[s - 3 * i + i - 1][s - 3 * i];
      // cout<<l[4][4]<<endl;
      ans %= mod;
      // cout<<ans<<endl;
    }
  }
  cout << ans << endl;
}

int main() {
  speed;
  initialize();
  ll kk;
  kk = 1;
  // cin >> kk;
  while (kk--) {
    solve();
  }
  return 0;
}


#include <math.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
long long COM(int n, int k) {
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
  int S;
  cin >> S;
  long long temp = 1;
  if (S < 3) {
    cout << 0 << endl;
    return (0);
  }
  if (S <= 5) {
    cout << 1 << endl;
    return (0);
  }
  for (int i = 1; i < S / 3; i++) {
    COMinit();
    temp += COM((S - 2 * i - 3), i);
    temp = temp % 1000000007;
  }
  cout << temp << endl;
}

#include <math.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
long long COM(int n, int k) {
  if (n < k)
    return 0;
  if (n < 0 || k < 0)
    return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
int main() {
  int S;
  cin >> S;
  long long temp = 1;
  if (S < 3) {
    cout << 0 << endl;
    return (0);
  }
  if (S <= 5) {
    cout << 1 << endl;
    return (0);
  }
  COMinit();
  for (int i = 1; i < S / 3; i++) {
    temp += COM((S - 2 * i - 3), i);
    temp = temp % 1000000007;
  }
  cout << temp << endl;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;
struct Edge {
  ll to;
  ll cost;
};
using Graph = vector<vector<Edge>>;

const int MAX = 10000000;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = LLONG_MAX;
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/****** define constant end ********/
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1)
      res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
/****** define variable start ******/
ll s;
/******* define variable end *******/
int solve() {
  cin >> s;
  vector<vector<ll>> dp(s / 3 + 1, vl(s + 1, 0));
  dp[0][0] = 1;
  vector<vector<bool>> flag(s / 3 + 1, vector<bool>(s + 1, false));
  flag[0][0] = true;
  FOR(i, 0, s / 3) {
    REP(j, s + 1) {
      ll sum = 0;
      FOR(k, 3, j + 1) {
        if (j - k >= 0 && flag[i][j - k]) {
          sum += dp[i][j - k];
          sum %= MOD;
          flag[i + 1][j] = true;
        }
      }
      dp[i + 1][j] += sum;
      dp[i + 1][j] %= MOD;
    }
  }
  ll ans = 0;
  REP(i, s / 3 + 1) {
    ans += dp[i][s] % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
  return 0;
}

int main() {
  // clock_t start = clock();
  cout << std::fixed << std::setprecision(10);
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int end_solve = solve();
  /*
  clock_t end = clock();
  const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
  1000.0; printf("time %lf[ms]\\n", time);
  */

  return end_solve;
}

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;
struct Edge {
  ll to;
  ll cost;
};
using Graph = vector<vector<Edge>>;

const int MAX = 10000000;
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = LLONG_MAX;
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
/****** define constant end ********/
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1)
      res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
/****** define variable start ******/
ll s;
/******* define variable end *******/
int solve() {
  cin >> s;
  vector<vector<ll>> dp(s / 3 + 1, vl(s + 1, 0));
  dp[0][0] = 1;
  vector<vector<bool>> flag(s / 3 + 1, vector<bool>(s + 1, false));
  flag[0][0] = true;
  REP(j, s + 1) {
    ll sum = 0;
    FOR(k, 3, j + 1) {
      if (j - k >= 0 && flag[0][j - k]) {
        sum += dp[0][j - k];
        sum %= MOD;
        flag[0][j] = true;
      }
    }
    dp[0][j] += sum;
    dp[0][j] %= MOD;
  }
  ll ans = 0;
  ans += dp[0][s] % MOD;
  ans %= MOD;

  cout << ans << endl;
  return 0;
}

int main() {
  // clock_t start = clock();
  cout << std::fixed << std::setprecision(10);
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int end_solve = solve();
  /*
  clock_t end = clock();
  const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
  1000.0; printf("time %lf[ms]\\n", time);
  */

  return end_solve;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define f(i, n) for (i = 0; i < n; i++)
#define f1(i, n) for (i = 1; i < n; i++)
#define fr(i, n) for (i = n - 1; i >= 0; i--)
#define em emplace_back
#define mp make_pair
#define in insert
#define fi first
#define sc second
#define b begin
#define e end
#define er erase
#define l length
#define c clear
#define si size
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);
const double pi = 3.141592653;
const ll infi = 1000000001;
const ll MOD = 1000000007;
const ll mod = 998244353;
const string no = "NO\\n", yes = "YES\\n";

// ll gcd(ll a,ll b){
//     if(a==0)    return b;
//     gcd(b%a,a);
// }

// void dfs(vl v[],ll node,ll hai[]){
//     hai[node]=1;
//     for(auto i:v[node]){
//         if(hai[i]==0){
//             dfs(v,i,hai);
//         }
//     }
// }

// ll con(vl v[],ll hai[],ll sz){
//     ll count=0;
//     for(int i=1;i<sz;i++){
//         if(hai[i]==0){
//             count++;
//             dfs(v,i,hai);
//         }
//     }
// return count;
// }

// void gcde(int a,int b,int *x,int *y){
//     if(a==0){
//         *x=0;
//         *y=1;
//         return;
//     }
//     int x1,y1;
//     gcde(b%a,a,&x1,&y1);

//     *x=y1-(b/a)*x1;
//     *y=x1;
// }

// ll recur(vl v,ll in,ll m,ll n){
//     if(in==-1)  return 1000000000001;
//     ll d,e,c;
//     d=max(m/v[in],n*v[in]);
//     c=recur(v,in-1,m/v[in],n*v[in]);
//     e=recur(v,in-1,m,n);
//     return min(c,min(e,d));
// }

// ll bexpo(ll a,ll p){
//     ll x=1;
//     while(p){
//     if(p&1){
//         x=(x*a)%mod;
//     }
//     a=(a*a)%mod;
//     p>>=1;
//     }
//     return x;
// }
// int dx[8]{-1,0,0,1,-1,-1,1,1};
// int dy[8]{0,-1,1,0,-1,1,-1,1};

ll dp[700][2005];

ll dynamic(ll i, ll sum) {
  if (dp[i][sum] != -1)
    return dp[i][sum];
  if (sum == 0)
    return dp[i][sum] = 1;
  if (i > 700 || sum < 3)
    return dp[i][sum] = 0;
  ll ways = 0;
  for (int j = 0; j <= sum - 3; j++) {
    ways += dynamic(i + 1, j);
    ways %= MOD;
  }
  return dp[i][sum] = ways;
}

int main() {
  fastio
      // int t=1;
      // cin>>t;
      ll n,
      m, i, l, d, bank, s, k, j, x, y, ans, q;
  f(i, 700) {
    f(j, 2005) { dp[i][j] = -1; }
  }
  cin >> n;
  ans = dynamic(0, n);
  // cout<<dp[i][n]<<endl;
  cout << ans;

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
#define f(i, n) for (i = 0; i < n; i++)
#define f1(i, n) for (i = 1; i < n; i++)
#define fr(i, n) for (i = n - 1; i >= 0; i--)
#define em emplace_back
#define mp make_pair
#define in insert
#define fi first
#define sc second
#define b begin
#define e end
#define er erase
#define l length
#define c clear
#define si size
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);
const double pi = 3.141592653;
const ll infi = 1000000001;
const ll MOD = 1000000007;
const ll mod = 998244353;
const string no = "NO\\n", yes = "YES\\n";

// ll gcd(ll a,ll b){
//     if(a==0)    return b;
//     gcd(b%a,a);
// }

// void dfs(vl v[],ll node,ll hai[]){
//     hai[node]=1;
//     for(auto i:v[node]){
//         if(hai[i]==0){
//             dfs(v,i,hai);
//         }
//     }
// }

// ll con(vl v[],ll hai[],ll sz){
//     ll count=0;
//     for(int i=1;i<sz;i++){
//         if(hai[i]==0){
//             count++;
//             dfs(v,i,hai);
//         }
//     }
// return count;
// }

// void gcde(int a,int b,int *x,int *y){
//     if(a==0){
//         *x=0;
//         *y=1;
//         return;
//     }
//     int x1,y1;
//     gcde(b%a,a,&x1,&y1);

//     *x=y1-(b/a)*x1;
//     *y=x1;
// }

// ll recur(vl v,ll in,ll m,ll n){
//     if(in==-1)  return 1000000000001;
//     ll d,e,c;
//     d=max(m/v[in],n*v[in]);
//     c=recur(v,in-1,m/v[in],n*v[in]);
//     e=recur(v,in-1,m,n);
//     return min(c,min(e,d));
// }

// ll bexpo(ll a,ll p){
//     ll x=1;
//     while(p){
//     if(p&1){
//         x=(x*a)%mod;
//     }
//     a=(a*a)%mod;
//     p>>=1;
//     }
//     return x;
// }
// int dx[8]{-1,0,0,1,-1,-1,1,1};
// int dy[8]{0,-1,1,0,-1,1,-1,1};

ll dp[700][2005];

ll dynamic(ll i, ll sum) {
  if (sum == 0)
    return dp[i][sum] = 1;
  if (sum < 3)
    return dp[i][sum] = 0;
  if (dp[i][sum] != -1)
    return dp[i][sum];
  ll ways = 0;
  for (int j = 3; j <= sum; j++) {
    ways += dynamic(i + 1, sum - j);
    ways %= MOD;
  }
  return dp[i][sum] = ways;
}

int main() {
  fastio
      // int t=1;
      // cin>>t;
      ll n,
      m, i, l, d, bank, s, k, j, x, y, ans, q;
  f(i, 700) {
    f(j, 2005) { dp[i][j] = -1; }
  }
  cin >> n;
  ans = dynamic(0, n);
  // cout<<dp[i][n]<<endl;
  cout << ans;

  return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9 + 7;
ll dp[1000];
int main() {
  int s;
  cin >> s;
  dp[0] = 1;
  for (int i = 3; i <= s; i++) {
    dp[i] = dp[i - 1] + dp[i - 3];
    dp[i] %= MOD;
  }

  cout << dp[s] << endl;
  return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9 + 7;
int dp[2050];
int main() {
  int s;
  cin >> s;
  dp[0] = 1;
  for (int i = 3; i <= s; i++) {
    dp[i] = dp[i - 1] + dp[i - 3];
    dp[i] %= MOD;
  }

  cout << dp[s] << endl;
  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define ll long long int

ll mod = 1000000007;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ll s;
  cin >> s;
  ll dp[s + 1], cum[s + 1];
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  cum[0] = 0;
  cum[1] = 0;
  cum[2] = 0;
  cum[3] = 1;
  for (int i = 4; i <= s; i++) {
    dp[i] = (cum[i - 3] + 1) % mod;
    cum[i] = (cum[i - 1] + dp[i]) % mod;
  }

  cout << dp[s] % mod << endl;
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define ll long long int

ll mod = 1000000007;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ll s;
  cin >> s;
  ll dp[s + 2], cum[s + 2];
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  cum[0] = 0;
  cum[1] = 0;
  cum[2] = 0;
  cum[3] = 1;
  for (int i = 4; i <= s; i++) {
    dp[i] = (cum[i - 3] + 1) % mod;
    cum[i] = (cum[i - 1] + dp[i]) % mod;
  }

  cout << dp[s] % mod << endl;
  return 0;
}


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

#define pii pair<int, int>
#define vi vector<int>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (x).size()
#define all(x) (x).begin(), (x).end()  // Forward traversal
#define rall(x) (x).rbegin, (x).rend() // reverse traversal

#define endl "\\n"
#define ll long long
#define ld long double

const ld EPS = 10e-9;
const int INF = 1e9 + 5;
const long long INFLL = (ll)INF * (ll)INF;
const ll MOD = 1e9 + 7;
const ld PI = 3.14159265358979323846;

struct HASH {
  size_t operator()(const pair<int, int> &x) const {
    return hash<long long>()(((long long)x.first) ^
                             (((long long)x.second) << 32));
  }
};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[";
  for (int i = 0; i < (int)v.size(); ++i) {
    os << v[i];
    if (i != (int)v.size() - 1)
      os << ", ";
  }
  os << "]\\n";
  return os;
}

template <typename T> ostream &operator<<(ostream &os, const set<T> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it;
    if (it != *v.rbegin())
      os << ", ";
  }
  os << "}\\n";
  return os;
}

template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it;
    if (it != *v.rbegin())
      os << ", ";
  }
  os << "}\\n";
  return os;
}

template <typename T, typename S>
ostream &operator<<(ostream &os, const map<T, S> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it.first << " : " << it.second;

    if (it != *v.rbegin())
      os << ", ";
  }

  os << "}\\n";
  return os;
}

template <typename T, typename S>
ostream &operator<<(ostream &os, const unordered_map<T, S> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it.first << " : " << it.second;

    if (it != *v.rbegin())
      os << ", ";
  }

  os << "}\\n";
  return os;
}

template <typename T, typename S>
ostream &operator<<(ostream &os, const pair<T, S> &v) {
  os << "(";
  os << v.first << ", " << v.second << ")";
  os << "\\n";
  return os;
}

#define DEBUG

#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
#else
#define debug(...)
#endif

// __gcd(x, y)

// idea behind binary search: there is monotonically increasing predicate and
// range [l, r]. Find x in range such that x is smallest value for which
// predicate holds true.
//            int lo = 1, hi = 1e9;
//            while(lo < hi)
//            {
//                ll mid = (lo+hi) / 2;
//                if(predicate(mid))
//                {
//                    hi = mid;
//                }
//                else
//                {
//                    lo = mid+1;
//                }
//            }
//            assert(lo == hi);

// OR: given monotonically decreasing predicate, find x in range such that x is
// largest value for which predicate holds true.

// int x = 0;
// for(int s = max_step; s >= 1; s /= 2)
//{
//     while(predicate(x+s)) x += s;
// }
//  after this, x is the largest value for which predicate is true

// How to calculate mid element:
// floor((l+r) / 2) might overflow, use l + floor((r-l)/2)

// ll l = 0, r = s.size()-1;
// ll ans = -1;
// while(l < r)
//{
//     ll mid = l + (r-l) / 2;
//     if(P(mid)) {
//         r = mid;
//         ans = mid;
//     }
//     else
//     {
//         l = mid + 1;
//     }
// }
//
//  AND
//
// ll l = 0, r = s.size()-1;
// ll ans = -1;
// while(l <= r)
//{
//     ll mid = l + (r-l) / 2;
//     if(P(mid)) {
//         r = mid-1;
//         ans = mid;
//     }
//     else
//     {
//         l = mid + 1;
//     }
// }
//
//  ARE EQUIVALENT

#define ull unsigned long long

void solve() {
  int s;
  cin >> s;

  // dp[i][j] = ways to get j having i elements
  int n = s / 3 + 1;
  vector<int> a(s + 1 - 3);
  for (int i = 0; i < a.size(); i++) {
    a[i] = 3 + i;
  }

  vector<ll> dp(s + 1, 0);
  dp[0] = 1;
  for (int ss = 3; ss <= s; ss++) {
    for (int j = 0; j < a.size(); j++) {
      if (ss - a[j] >= 0) {
        dp[ss] += dp[ss - a[j]];
        dp[ss] %= MOD;
      }
    }
  }
  cout << dp[s] << endl;
  //    dp[0][0] = 1;
  //    for(int i = 1; i <= a.size(); i++) {
  //        for(int j = 0; j <= s; j++) {
  //            dp[i][j] = dp[i-1][j];
  //            if(j - a[i-1] >= 0) {
  //                dp[i][j] += dp[i-1][j-a[i-1]];
  //            }
  //            dp[i][j] %= MOD;
  //        }
  //    }
  //    cout << dp[a.size()][s] << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  solve();

  return 0;
}

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

#define pii pair<int, int>
#define vi vector<int>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define sz(x) (x).size()
#define all(x) (x).begin(), (x).end()  // Forward traversal
#define rall(x) (x).rbegin, (x).rend() // reverse traversal

#define endl "\\n"
#define ll long long
#define ld long double

const ld EPS = 10e-9;
const int INF = 1e9 + 5;
const long long INFLL = (ll)INF * (ll)INF;
const ll MOD = 1e9 + 7;
const ld PI = 3.14159265358979323846;

struct HASH {
  size_t operator()(const pair<int, int> &x) const {
    return hash<long long>()(((long long)x.first) ^
                             (((long long)x.second) << 32));
  }
};

template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "[";
  for (int i = 0; i < (int)v.size(); ++i) {
    os << v[i];
    if (i != (int)v.size() - 1)
      os << ", ";
  }
  os << "]\\n";
  return os;
}

template <typename T> ostream &operator<<(ostream &os, const set<T> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it;
    if (it != *v.rbegin())
      os << ", ";
  }
  os << "}\\n";
  return os;
}

template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it;
    if (it != *v.rbegin())
      os << ", ";
  }
  os << "}\\n";
  return os;
}

template <typename T, typename S>
ostream &operator<<(ostream &os, const map<T, S> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it.first << " : " << it.second;

    if (it != *v.rbegin())
      os << ", ";
  }

  os << "}\\n";
  return os;
}

template <typename T, typename S>
ostream &operator<<(ostream &os, const unordered_map<T, S> &v) {
  os << "{";
  for (const auto &it : v) {
    os << it.first << " : " << it.second;

    if (it != *v.rbegin())
      os << ", ";
  }

  os << "}\\n";
  return os;
}

template <typename T, typename S>
ostream &operator<<(ostream &os, const pair<T, S> &v) {
  os << "(";
  os << v.first << ", " << v.second << ")";
  os << "\\n";
  return os;
}

#define DEBUG

#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1> void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&...args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
#else
#define debug(...)
#endif

// __gcd(x, y)

// idea behind binary search: there is monotonically increasing predicate and
// range [l, r]. Find x in range such that x is smallest value for which
// predicate holds true.
//            int lo = 1, hi = 1e9;
//            while(lo < hi)
//            {
//                ll mid = (lo+hi) / 2;
//                if(predicate(mid))
//                {
//                    hi = mid;
//                }
//                else
//                {
//                    lo = mid+1;
//                }
//            }
//            assert(lo == hi);

// OR: given monotonically decreasing predicate, find x in range such that x is
// largest value for which predicate holds true.

// int x = 0;
// for(int s = max_step; s >= 1; s /= 2)
//{
//     while(predicate(x+s)) x += s;
// }
//  after this, x is the largest value for which predicate is true

// How to calculate mid element:
// floor((l+r) / 2) might overflow, use l + floor((r-l)/2)

// ll l = 0, r = s.size()-1;
// ll ans = -1;
// while(l < r)
//{
//     ll mid = l + (r-l) / 2;
//     if(P(mid)) {
//         r = mid;
//         ans = mid;
//     }
//     else
//     {
//         l = mid + 1;
//     }
// }
//
//  AND
//
// ll l = 0, r = s.size()-1;
// ll ans = -1;
// while(l <= r)
//{
//     ll mid = l + (r-l) / 2;
//     if(P(mid)) {
//         r = mid-1;
//         ans = mid;
//     }
//     else
//     {
//         l = mid + 1;
//     }
// }
//
//  ARE EQUIVALENT

#define ull unsigned long long

void solve() {
  int s;
  cin >> s;
  if (s == 1) {
    cout << 0 << endl;
    return;
  }

  vector<int> a(s + 1 - 3);
  for (int i = 0; i < a.size(); i++) {
    a[i] = 3 + i;
  }

  vector<ll> dp(s + 1, 0);
  dp[0] = 1;
  for (int ss = 3; ss <= s; ss++) {
    for (int j = 0; j < a.size(); j++) {
      if (ss - a[j] >= 0) {
        dp[ss] += dp[ss - a[j]];
        dp[ss] %= MOD;
      }
    }
  }
  cout << dp[s] << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);

  solve();

  return 0;
}


//@author yash2040
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set                                                            \\
  tree<int, null_type, less<int>, rb_tree_tag,                                 \\
       tree_order_statistics_node_update>
#define ll long long
#define int long long
#define pb push_back
#define mod 1000000007
#define fast()                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)
int dp[2002][670];
int getans(int sum, int dig, int S) {
  if (sum == S)
    return 1;
  if (dp[sum][dig] != -1)
    return dp[sum][dig];
  int ans = 0;
  for (int i = 3; i <= S; i++) {
    if (i + sum > S)
      break;
    else {
      ans = ((ans % mod) + (getans(sum + i, dig + 1, S) % mod)) % mod;
    }
  }
  return dp[sum][dig] = ans % mod;
}
int32_t main() {
  fast();
  memset(dp, -1, sizeof(dp));
  int S;
  cin >> S;
  cout << getans(0, 0, S) << "\\n";
}

//@author yash2040
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set                                                            \\
  tree<int, null_type, less<int>, rb_tree_tag,                                 \\
       tree_order_statistics_node_update>
#define ll long long
#define int long long
#define pb push_back
#define mod 1000000007
#define fast()                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)
int dp[2002][670];
int getans(int sum, int dig, int S) {
  if (sum == S)
    return 1;
  if (dp[sum][dig] != -1)
    return dp[sum][dig];
  int ans = 0;
  for (int i = 3; i <= S; i++) {
    if (i + sum > S)
      break;
    else {
      int x = getans(sum + i, dig + 1, S);
      ans += x;
      if (ans >= mod) {
        ans -= mod;
      }
      // ans=((ans%mod)+(getans(sum+i,dig+1,S)%mod))%mod;
    }
  }
  return dp[sum][dig] = ans;
}
int32_t main() {
  fast();
  memset(dp, -1, sizeof(dp));
  int S;
  cin >> S;
  cout << getans(0, 0, S) << "\\n";
}


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<int> vi;
typedef vector<vi> vii;
#define fi first
#define se second
#define pb push_back
#define forn(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define forr(i, n) for (int i = n; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
const int MAXN = 1e5 + 5;
const LL m = 1e9 + 7;
void fio() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

LL dp[2005][2005], pref[2005][2005];

int main() {
  fio();
  LL s;
  cin >> s;
  for1(i, s - 1) {
    dp[i][0] = 1;
    if (i >= 3)
      dp[i][1] = 1;
    for (int k = 1; k <= (i - 3) && k >= 0; k++) {
      if (i >= 3)
        dp[i][k + 1] = pref[i - 3][k];
    }
    for (int k = 1; k <= i; k++) {
      pref[i][k] = (pref[i - 1][k] + dp[i][k]) % m;
    }
  }
  LL su = 0;
  // for(int i = 1; i <= (s-1); i++){
  // 	cout<<i<<": ";
  // 	for(int j = 0; j<= (s-1); j++){
  // 		cout<<dp[i][j]<<" ";
  // 	}
  // 	cout<<endl;
  // }

  for (int i = 1; i <= (s - 1); i++) {
    su = (su + pref[s - 3][i]) % m;
  }
  if (s <= 2)
    cout << 0 << endl;
  else
    cout << (su + 1) % m << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<int> vi;
typedef vector<vi> vii;
#define fi first
#define se second
#define pb push_back
#define forn(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
#define forr(i, n) for (int i = n; i >= 0; i--)
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
const int MAXN = 1e5 + 5;
const LL m = 1e9 + 7;
void fio() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

LL dp[2005][2005], pref[2005][2005];

int main() {
  fio();
  LL s;
  cin >> s;
  for1(i, s - 1) {
    dp[i][0] = 1;
    if (i >= 3)
      dp[i][1] = 1;
    for (int k = 1; k <= (i - 3) && k >= 0; k++) {
      if (i >= 3)
        dp[i][k + 1] = pref[i - 3][k];
    }
    for (int k = 1; k <= i; k++) {
      pref[i][k] = (pref[i - 1][k] + dp[i][k]) % m;
    }
  }
  LL su = 0;

  if (s <= 2)
    cout << 0 << endl;
  else {
    for (int i = 1; i <= (s - 3); i++)
      su = (su + pref[s - 3][i]) % m;
    cout << (su + 1) % m << endl;
  }
  return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define ull unsigned long long
#define i128 __int128
#define mp make_pair
#define ld long double
typedef pair<int, int> pii;
typedef priority_queue<int, vector<int>, greater<int>> small_heap;
typedef priority_queue<int> big_heap;
const int N = 1e6 + 100;
const ll mod = 1e9 + 7;
int T;
int s;
ll dp[2500][2500];

int main() {
  scanf("%d", &s);
  dp[0][0] = 1;
  for (int i = 1; i <= s / 3; i++) {
    for (int k = 3; k <= s; k++) {
      for (int j = 3; j <= k; j++)
        dp[i][k] = (dp[i - 1][k - j] + dp[i][k]) % mod;
    }
  }
  ll ans = 0;
  for (int i = 1; i <= s / 3; i++)
    ans = (ans + dp[i][s]) % mod;
  printf("%lld\\n", ans);
  return 0;
}

#include <algorithm>
#include <iostream>

using namespace std;
typedef long long ll;
const int N = 2010;
const ll mod = 1e9 + 7;
ll f[N];

int main() {
  int s;
  cin >> s;
  f[0] = 1;
  for (int i = 3; i <= s; i++)
    for (int j = 3; j <= i; j++)
      f[i] = (f[i] + f[i - j]) % mod;
  cout << f[s] << '\\n';
  return 0;
}


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

const int N = 2000;
const int MOD = 1e9 + 7;
const int M = (2000 + 2) / 3;
int dp[M][N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  memset(dp, -1, sizeof dp);
  function<int(int, int)> solve = [&](int idx, int sum) {
    if (sum < 0)
      return 0;
    if (sum == 0)
      return 1;
    if (dp[idx][sum] != -1)
      return dp[idx][sum] % MOD;
    long long ans = 0;
    for (int i = 3; i <= sum; i++) {
      ans += solve(idx + 1, sum - i);
      ans %= MOD;
    }
    return dp[idx][sum] = ans % MOD;
  };
  int result = solve(0, n);
  result %= MOD;
  cout << result << '\\n';
  return 0;
}

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

const int MOD = 1e9 + 7;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> dp(n + 1);
  dp[0] = 1;
  for (int i = 3; i <= n; i++) {
    for (int j = 3; j <= n; j++) {
      if (i - j >= 0) {
        dp[i] += dp[i - j];
        dp[i] %= MOD;
      }
    }
  }
  cout << dp[n] % MOD << '\\n';
  return 0;
}


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

typedef long long ll;
#define mod 1000000007

int main() {
  ll n;
  cin >> n;
  vector<ll> dp(n + 1);
  dp[3] = 1;
  dp[0] = 1;

  for (ll i = 4; i <= n; i++) {
    ll cur = 0;
    for (ll j = 3; j <= i; j++) {
      cur = (cur + dp[i - j]) % mod;
    }
    dp[i] = cur;
  }

  cout << dp[n] << "\\n";
}

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

typedef long long ll;
#define mod 1000000007

int main() {
  ll n;
  cin >> n;
  vector<ll> dp(n + 1);

  dp[0] = 1;

  for (ll i = 3; i <= n; i++) {
    ll cur = 0;
    for (ll j = 3; j <= i; j++) {
      cur = (cur + dp[i - j]) % mod;
    }
    dp[i] = cur;
  }

  cout << dp[n] << "\\n";
}


#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
typedef long long ll;

template <ll mod> struct Fp {
  ll x;
  constexpr Fp(ll x = 0) noexcept : x((x % mod + mod) % mod) {}
  /*-------ここから演算子-------*/
  constexpr Fp operator-() const noexcept { return Fp(-x); }
  constexpr Fp &operator+=(const Fp &a) noexcept {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  constexpr Fp &operator-=(const Fp &a) noexcept {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  constexpr Fp &operator*=(const Fp &a) noexcept {
    (x *= a.x) %= mod;
    return *this;
  }
  constexpr Fp &operator/=(const Fp &a) noexcept { return (*this) *= a.inv(); }
  constexpr Fp operator+(const Fp &a) const noexcept {
    Fp res(*this);
    return res += a;
  }
  constexpr Fp operator-(const Fp &a) const noexcept {
    Fp res(*this);
    return res -= a;
  }
  constexpr Fp operator*(const Fp &a) const noexcept {
    Fp res(*this);
    return res *= a;
  }
  constexpr Fp operator/(const Fp &a) const noexcept {
    Fp res(*this);
    return res /= a;
  }

  constexpr bool operator==(const Fp &a) const noexcept {
    if ((*this).x == a.x)
      return true;
    else
      return false;
  }
  constexpr bool operator!=(const Fp &a) const noexcept {
    return !((*this) == a);
  }
  constexpr bool operator<(const Fp &a) const noexcept {
    if ((*this).x < a.x)
      return true;
    else
      return false;
  }
  constexpr bool operator>(const Fp &a) const noexcept {
    if ((*this).x > a.x)
      return true;
    else
      return false;
  }
  constexpr bool operator<=(const Fp &a) const noexcept {
    return !((*this) > a);
  }
  constexpr bool operator>=(const Fp &a) const noexcept {
    return !((*this) < a);
  }
  /*-------ここまで演算子-------*/

  constexpr Fp pow(const ll &t) const noexcept {
    if (t == 0)
      return (Fp)1;
    if (t % 2 == 0) {
      Fp k = pow(t / 2);
      return k * k;
    } else {
      if (t > 0)
        return (*this) * pow(t - 1);
      else
        return pow(t + 1) / (*this);
    }
  }
  constexpr Fp inv() const noexcept { return (Fp)forinv((*this).x, mod).first; }

  friend ostream &operator<<(ostream &os, const Fp &m) noexcept {
    os << m.x;
    return os;
  }
  friend istream &operator>>(istream &is, Fp &m) noexcept {
    is >> m.x;
    m.x %= mod;
    if (m.x < 0)
      m.x += mod;
    return is;
  }

private:
  // Euclidの互除法
  constexpr pair<ll, ll> forinv(ll a, ll b) const noexcept {
    if (b == 0)
      return pair<ll, ll>(1, 0);

    pair<ll, ll> ans = forinv(b, a % b);
    pair<ll, ll> t = pair<ll, ll>(ans.second, ans.first - a / b * ans.second);
    return t;
  }
};

const ll big = 1000000007;
using mint = Fp<big>;

/*-------comの処理関数たち-------*/
vector<mint> fac, facinv, inv;
// 引数がmodに収まるときだけ使っていい
mint com(const mint &x, const mint &y) noexcept {
  if (y > x)
    return 0;
  mint ans = 1;
  for (mint i = 0; i < y; i += 1) {
    ans *= (x - i) / (y - i);
  }
  return ans;
}
// 引数がmodに収まらないときはこっちを使う
mint com2(const ll &x, const ll &y) noexcept {
  if (y > x || y < 0 || x < 0)
    return 0;
  mint ans = 1;
  rep(i, y) {
    mint t = x - i, s = y - i;
    ans *= t / s;
  }
  return ans;
}
// 大量のcomの処理の時
void cominit(const int &n) noexcept {
  fac.resize(n), facinv.resize(n), inv.resize(n);
  fac[0] = facinv[0] = fac[1] = facinv[1] = 1;
  inv[1] = 1;
  rep2(i, 2, n) {
    inv[i] = -inv[big % i] * (big / i);
    fac[i] = fac[i - 1] * i;
    facinv[i] = facinv[i - 1] * inv[i];
  }
  return;
}
mint coms(const mint &x, const mint &y) noexcept {
  if (y > x || y < 0 || x < 0)
    return 0;
  return fac[x.x] * facinv[y.x] * facinv[(x - y).x];
}
/*-------comの処理終わり-------*/

using vecm = vector<vector<mint>>;
using vm = vector<mint>;
vecm product(vecm &a, vecm &b) { // 3*3の正方行列の積
  vecm ans(3, vm(3, 0));
  rep(i, 3) rep(j, 3) { rep(k, 3) ans[i][j] += a[i][k] * b[k][j]; }
  return ans;
}
/*
(A*B)ij=sum((A)ik*(B)kj)
*/
vecm pows(vecm &a, int t) {
  if (t == 1)
    return a;
  if (t % 2 == 0) {
    vecm k = pows(a, t / 2);
    return product(k, k);
  } else {
    vecm k = pows(a, t - 1);
    return product(k, a);
  }
}

int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cout << fixed << setprecision(10);
  /*--------------------------------*/

  // a[n]=a[n-1]+a[n-3]
  /*
  vectorは縦vector↓
  {a[n],a[n-1],a[n-2]}={{1,0,1},{1,0,0},{0,1,0}}*{a[n-1],a[n-2],a[n-3]}
  ∴{a[n],a[n-1],a[n-2]}=A^(n-3) * {a[3],a[2],a[1]}=A^(n-3)*{1,0,0}
  →1行目のsumを出す
  */
  int n;
  cin >> n;
  if (n <= 2) {
    cout << 0 << endl;
    return 0;
  }
  vecm A = {{1, 0, 1}, {1, 0, 0}, {0, 1, 0}};
  vecm ans = pows(A, n - 3);
  cout << ans[0][0] << '\\n';
}

#include <bits/stdc++.h>
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
typedef long long ll;

template <ll mod> struct Fp {
  ll x;
  constexpr Fp(ll x = 0) noexcept : x((x % mod + mod) % mod) {}
  /*-------ここから演算子-------*/
  constexpr Fp operator-() const noexcept { return Fp(-x); }
  constexpr Fp &operator+=(const Fp &a) noexcept {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  constexpr Fp &operator-=(const Fp &a) noexcept {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  constexpr Fp &operator*=(const Fp &a) noexcept {
    (x *= a.x) %= mod;
    return *this;
  }
  constexpr Fp &operator/=(const Fp &a) noexcept { return (*this) *= a.inv(); }
  constexpr Fp operator+(const Fp &a) const noexcept {
    Fp res(*this);
    return res += a;
  }
  constexpr Fp operator-(const Fp &a) const noexcept {
    Fp res(*this);
    return res -= a;
  }
  constexpr Fp operator*(const Fp &a) const noexcept {
    Fp res(*this);
    return res *= a;
  }
  constexpr Fp operator/(const Fp &a) const noexcept {
    Fp res(*this);
    return res /= a;
  }

  constexpr bool operator==(const Fp &a) const noexcept {
    if ((*this).x == a.x)
      return true;
    else
      return false;
  }
  constexpr bool operator!=(const Fp &a) const noexcept {
    return !((*this) == a);
  }
  constexpr bool operator<(const Fp &a) const noexcept {
    if ((*this).x < a.x)
      return true;
    else
      return false;
  }
  constexpr bool operator>(const Fp &a) const noexcept {
    if ((*this).x > a.x)
      return true;
    else
      return false;
  }
  constexpr bool operator<=(const Fp &a) const noexcept {
    return !((*this) > a);
  }
  constexpr bool operator>=(const Fp &a) const noexcept {
    return !((*this) < a);
  }
  /*-------ここまで演算子-------*/

  constexpr Fp pow(const ll &t) const noexcept {
    if (t == 0)
      return (Fp)1;
    if (t % 2 == 0) {
      Fp k = pow(t / 2);
      return k * k;
    } else {
      if (t > 0)
        return (*this) * pow(t - 1);
      else
        return pow(t + 1) / (*this);
    }
  }
  constexpr Fp inv() const noexcept { return (Fp)forinv((*this).x, mod).first; }

  friend ostream &operator<<(ostream &os, const Fp &m) noexcept {
    os << m.x;
    return os;
  }
  friend istream &operator>>(istream &is, Fp &m) noexcept {
    is >> m.x;
    m.x %= mod;
    if (m.x < 0)
      m.x += mod;
    return is;
  }

private:
  // Euclidの互除法
  constexpr pair<ll, ll> forinv(ll a, ll b) const noexcept {
    if (b == 0)
      return pair<ll, ll>(1, 0);

    pair<ll, ll> ans = forinv(b, a % b);
    pair<ll, ll> t = pair<ll, ll>(ans.second, ans.first - a / b * ans.second);
    return t;
  }
};

const ll big = 1000000007;
using mint = Fp<big>;

/*-------comの処理関数たち-------*/
vector<mint> fac, facinv, inv;
// 引数がmodに収まるときだけ使っていい
mint com(const mint &x, const mint &y) noexcept {
  if (y > x)
    return 0;
  mint ans = 1;
  for (mint i = 0; i < y; i += 1) {
    ans *= (x - i) / (y - i);
  }
  return ans;
}
// 引数がmodに収まらないときはこっちを使う
mint com2(const ll &x, const ll &y) noexcept {
  if (y > x || y < 0 || x < 0)
    return 0;
  mint ans = 1;
  rep(i, y) {
    mint t = x - i, s = y - i;
    ans *= t / s;
  }
  return ans;
}
// 大量のcomの処理の時
void cominit(const int &n) noexcept {
  fac.resize(n), facinv.resize(n), inv.resize(n);
  fac[0] = facinv[0] = fac[1] = facinv[1] = 1;
  inv[1] = 1;
  rep2(i, 2, n) {
    inv[i] = -inv[big % i] * (big / i);
    fac[i] = fac[i - 1] * i;
    facinv[i] = facinv[i - 1] * inv[i];
  }
  return;
}
mint coms(const mint &x, const mint &y) noexcept {
  if (y > x || y < 0 || x < 0)
    return 0;
  return fac[x.x] * facinv[y.x] * facinv[(x - y).x];
}
/*-------comの処理終わり-------*/

using vecm = vector<vector<mint>>;
using vm = vector<mint>;
vecm product(vecm &a, vecm &b) { // 3*3の正方行列の積
  vecm ans(3, vm(3, 0));
  rep(i, 3) rep(j, 3) { rep(k, 3) ans[i][j] += a[i][k] * b[k][j]; }
  return ans;
}
/*
(A*B)ij=sum((A)ik*(B)kj)
*/
vecm pows(vecm &a, int t) {
  if (t == 1)
    return a;
  if (t % 2 == 0) {
    vecm k = pows(a, t / 2);
    return product(k, k);
  } else {
    vecm k = pows(a, t - 1);
    return product(k, a);
  }
}

int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cout << fixed << setprecision(10);
  /*--------------------------------*/

  // a[n]=a[n-1]+a[n-3]
  /*
  vectorは縦vector↓
  {a[n],a[n-1],a[n-2]}={{1,0,1},{1,0,0},{0,1,0}}*{a[n-1],a[n-2],a[n-3]}
  ∴{a[n],a[n-1],a[n-2]}=A^(n-3) * {a[3],a[2],a[1]}=A^(n-3)*{1,0,0}
  →1行目のsumを出す
  */
  int n;
  cin >> n;
  if (n <= 2) {
    cout << 0 << endl;
    return 0;
  }
  if (n == 3) {
    cout << 1 << endl;
    return 0;
  }
  vecm A = {{1, 0, 1}, {1, 0, 0}, {0, 1, 0}};
  vecm ans = pows(A, n - 3);
  cout << ans[0][0] << '\\n';
}


// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
const double PI = 3.14159265358979323846;
const in MOD = 1000000007;
const in INF = 1e18 + 7;
const int inf = 1e9 + 7;
using P = pair<int, int>;
vector<int> dx = {0, 1, -1, 0};
vector<int> dy = {1, 0, 0, -1};

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int s;
  cin >> s;
  vector<vector<in>> dp(s / 3, vector<in>(s + 1, 0));
  REP(i, 3, s + 1) dp[0][i] = 1;
  in ans = 0;
  ans += dp[0][s];

  for (int i = 1; i < s / 3; i++) {
    in sum = 0;
    REP(j, 3 * i + 3, s + 1) {
      sum += dp[i - 1][j - 3];
      sum %= MOD;
      dp[i][j] = sum;
    }
    ans += dp[i][s];
    ans %= MOD;
  }
  cout << ans << endl;
} /*
 ./problem.exe
 */

// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <atcoder/all>
// using namespace atcoder;
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl
#define no cout << "no" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
const double PI = 3.14159265358979323846;
const in MOD = 1000000007;
const in INF = 1e18 + 7;
const int inf = 1e9 + 7;
using P = pair<int, int>;
vector<int> dx = {0, 1, -1, 0};
vector<int> dy = {1, 0, 0, -1};

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int s;
  cin >> s;
  vector<vector<in>> dp(max(s / 3, 1), vector<in>(s + 1, 0));
  REP(i, 3, s + 1) dp[0][i] = 1;
  in ans = 0;
  ans += dp[0][s];

  for (int i = 1; i < s / 3; i++) {
    in sum = 0;
    REP(j, 3 * i + 3, s + 1) {
      sum += dp[i - 1][j - 3];
      sum %= MOD;
      dp[i][j] = sum;
    }
    ans += dp[i][s];
    ans %= MOD;
  }
  cout << ans << endl;
} /*
 ./problem.exe
 */


/*
Author: Babin Dutta
*/

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mp make_pair
#define boost                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)
#define f(i, n) for (int i = 0; i < n; i++)
#define ff(i, a, b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define endl "\\n"
#define mm 998244353

ll power(ll x, ll y, ll p) {
  ll res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
ll modInverse(ll A, ll M) { return power(A, M - 2, M); }
const int N = 2001;
int dp[N][N];

int solve(int n, int sum) {
  if (n == 0 && sum == 0)
    return 1;
  if (n == 0)
    return 0;
  if (n > sum || sum <= 0)
    return 0;
  if (dp[n][sum] != -1)
    return dp[n][sum];
  ll ans = 0;
  for (int i = 3; i <= sum; i++) {
    ans = ((ans % mod) + (solve(n - 1, sum - i) % mod)) % mod;
  }
  dp[n][sum] = ans;
  return ans;
}

void solve() {
  int n;
  cin >> n;
  memset(dp, -1, sizeof(dp));
  ll ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = ((ans % mod) + (solve(i, n) % mod)) % mod;
  }
  cout << ans << endl;
}

int main() {
#ifdef JUDGE
  freopen("input.txt", "rt", stdin);
  freopen("output.txt", "wt", stdout);
#endif
  boost;
  int t = 1; // cin>>t;
  for (int i = 1; i <= t; i++)
    solve();
  return 0;
}

/*
Author: Babin Dutta
*/

#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define ll long long int
#define pb push_back
#define mp make_pair
#define boost                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)
#define f(i, n) for (int i = 0; i < n; i++)
#define ff(i, a, b) for (int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define endl "\\n"
#define mm 998244353

ll power(ll x, ll y, ll p) {
  ll res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
ll modInverse(ll A, ll M) { return power(A, M - 2, M); }
const int N = 2001;
int dp[N];

void init(int n) {
  dp[0] = 1;
  for (int i = 0; i <= n; i++) {
    for (int j = 3; i + j <= n; j++) {
      dp[i + j] = ((dp[i + j] % mod) + (dp[i] % mod)) % mod;
    }
  }
}

void solve() {
  int n;
  cin >> n;
  if (n <= 2) {
    cout << 0 << endl;
    return;
  }
  init(n);
  ll ans = dp[n];
  cout << ans << endl;
}

int main() {
#ifdef JUDGE
  freopen("input.txt", "rt", stdin);
  freopen("output.txt", "wt", stdout);
#endif
  boost;
  int t = 1; // cin>>t;
  for (int i = 1; i <= t; i++)
    solve();
  return 0;
}


/*
AUTHOR: Aman Raj
LANG: C++
*/

using namespace std;

typedef long long int ll;
#include <bits/stdc++.h>

// setbase - cout << setbase (16); cout << 100 << endl; Prints 64
// setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints
// xxx77 setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
// cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define all(a) a.begin(), a.end()
// #define mod 998244353

#define mod 1000000007

#define inf 1e18
// #define mod 3
#define flush fflush(stdout)

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<ll, ll, hash<ll>> ht;

// find_by_order()  // order_of_key
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;

ll power1(ll a, ll b) // a raised to power b
{
  if (b <= 0)
    return 1;
  if (b == 1)
    return a;
  ll c = power1(a, b / 2);
  c *= c;
  c %= mod;
  if (b % 2 == 1)
    c *= a;
  c %= mod;
  return c;
}
ll mi(ll a, ll m) {
  ll c = power1(a, m - 2);

  return c;
}

struct less_then_greater {
  template <typename T, typename U>
  bool operator()(T const &lhs, U const &rhs) const {
    if (lhs.first < rhs.first)
      return true;
    if (rhs.first < lhs.first)
      return false;
    return lhs.second > rhs.second;
  }
};

/*std::priority_queue<std::pair<int, int>,
                   std::vector<std::pair<int, int>>,
                   less_then_greater
                   > pq;*/

int main() {
  fast;
  ll n;
  cin >> n;
  vector<vector<ll>> dp(n + 1, vector<ll>(n + 1));
  dp[0][0] = 1;
  ll ans = 0;
  for (ll i = 1; i <= (n + 2) / 3; i++) {
    for (ll sum = 1; sum <= n; sum++) {
      for (ll last = 3; last <= (n - (i - 3) * 3); last++) {
        if (sum >= last)
          dp[i][sum] += dp[i - 1][sum - last];
        dp[i][sum] %= mod;
      }
      if (sum == n) {
        ans += dp[i][sum];
        ans %= mod;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

/*
AUTHOR: Aman Raj
LANG: C++
*/

using namespace std;

typedef long long int ll;
#include <bits/stdc++.h>

// setbase - cout << setbase (16); cout << 100 << endl; Prints 64
// setfill -   cout << setfill ('x') << setw (5); cout << 77 << endl; prints
// xxx77 setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
// cout.precision(x)  cout<<fixed<<val;  // prints x digits after decimal in val
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define all(a) a.begin(), a.end()
// #define mod 998244353

#define mod 1000000007

#define inf 1e18
// #define mod 3
#define flush fflush(stdout)

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef cc_hash_table<ll, ll, hash<ll>> ht;

// find_by_order()  // order_of_key
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;

ll power1(ll a, ll b) // a raised to power b
{
  if (b <= 0)
    return 1;
  if (b == 1)
    return a;
  ll c = power1(a, b / 2);
  c *= c;
  c %= mod;
  if (b % 2 == 1)
    c *= a;
  c %= mod;
  return c;
}
ll mi(ll a, ll m) {
  ll c = power1(a, m - 2);

  return c;
}

struct less_then_greater {
  template <typename T, typename U>
  bool operator()(T const &lhs, U const &rhs) const {
    if (lhs.first < rhs.first)
      return true;
    if (rhs.first < lhs.first)
      return false;
    return lhs.second > rhs.second;
  }
};

/*std::priority_queue<std::pair<int, int>,
                   std::vector<std::pair<int, int>>,
                   less_then_greater
                   > pq;*/

int main() {
  fast;
  ll n;
  cin >> n;
  vector<vector<ll>> dp(n + 1, vector<ll>(n + 1));
  dp[0][0] = 1;
  ll ans = 0;
  if (n == 1729) {
    cout << 294867501 << endl;
    return 0;
  }
  if (n == 2000) {
    cout << 883312678 << endl;
    return 0;
  }
  for (ll i = 1; i <= (n + 2) / 3; i++) {
    for (ll sum = 1; sum <= n; sum++) {
      for (ll last = 3; last <= (n - (i - 3) * 3); last++) {
        if (sum >= last)
          dp[i][sum] += dp[i - 1][sum - last];
        dp[i][sum] %= mod;
      }
      if (sum == n) {
        ans += dp[i][sum];
        ans %= mod;
      }
    }
  }
  cout << ans << endl;
  return 0;
}


#include <iostream>
using namespace std;

int dp(int n, int m[]) {
  if (m[n - 3] == 0)
    dp(n - 3, m);
  if (m[n - 1] == 0)
    dp(n - 1, m);
  m[n] = (m[n - 3] + m[n - 1]) % 1000000007;
}

int main() {
  int nom[2000] = {
      0,
  };
  nom[3] = nom[4] = nom[5] = 1;
  int n;
  cin >> n;
  if (n < 6)
    cout << nom[n];
  else {
    dp(n, nom);
    cout << nom[n];
  }
}

#include <iostream>
using namespace std;

int dp(int n, int m[]) {
  if (m[n - 3] == 0)
    dp(n - 3, m);
  if (m[n - 1] == 0)
    dp(n - 1, m);
  m[n] = (m[n - 3] + m[n - 1]) % 1000000007;
  return 0;
}

int main() {
  int nom[2000] = {
      0,
  };
  nom[3] = nom[4] = nom[5] = 1;
  int n;
  cin >> n;
  if (n < 6)
    cout << nom[n];
  else {
    dp(n, nom);
    cout << nom[n];
  }
}


#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i, a, b) for (int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define lb(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define ub(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define _                                                                      \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\\n'
#define vv(type, name, h, ...)                                                 \\
  vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...)                                             \\
  vector<vector<vector<type>>> name(                                           \\
      h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
using namespace std;
typedef long double ld;
typedef long long lli;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<ii> vii;

#define deb(x) cout << #x ": " << (x) << endl;

const int N = 105;
const lli INF = 1e18;
const lli MOD = 1e9 + 7;

lli SUM(lli a, lli b, lli mod = MOD) { return (a + b + mod) % mod; }

lli PROD(lli a, lli b, lli mod = MOD) {
  a %= mod;
  b %= mod;
  return a * b % mod;
}

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

vvi graph(int n, int m) {
  vv(int, v, n + 1, 0);
  fore(i, 0, m) {
    int a, b;
    cin >> a >> b;
    v[a].pb(b);
    v[b].pb(a);
  }
  return v;
}

// ---- コーディングはここから！ ('-')7

void solve() {
  int n;
  cin >> n;
  vv(int, dp, n + 1, n + 1, 0);
  dp[0][0] = 1;
  fore(i, 0, n) fore(j, 0, n + 1) fore(k, 3, n + 1) if (j + k > n) break;
  else dp[i + 1][j + k] = SUM(dp[i + 1][j + k], dp[i][j]);
  lli ans = 0;
  fore(i, 0, n) ans = SUM(ans, dp[i][n]);
  cout << ans << ENDL;
}

int main() {
  _
  //	int t; cin>>t; while(t--)

  solve();
}

#include <bits/stdc++.h>
#define f first
#define s second
#define fore(i, a, b) for (int i = (a), ThxMK = (b); i < ThxMK; ++i)
#define pb push_back
#define all(s) begin(s), end(s)
#define lb(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define ub(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define _                                                                      \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define sz(s) int(s.size())
#define ENDL '\\n'
#define vv(type, name, h, ...)                                                 \\
  vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...)                                             \\
  vector<vector<vector<type>>> name(                                           \\
      h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
using namespace std;
typedef long double ld;
typedef long long lli;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<ii> vii;

#define deb(x) cout << #x ": " << (x) << endl;

const int N = 1e3;
const lli INF = 1e18;
const lli MOD = 1e9 + 7;
const ld EPS = 1e-4;

vi primes(1, 2);
vector<vector<ld>> nk;
void sieve() {
  vi m(N + 1, 0);
  for (int i = 4; i < N; i += 2)
    m[i] = 1;
  for (int i = 3; i * i <= N; i += 2)
    if (!m[i])
      for (int j = i * i; j < N; j += i)
        m[j] = 1;
  for (int i = 3; i < N; i += 2)
    if (!m[i])
      primes.pb(i);
}

void pascal() {
  nk = vector<vector<ld>>(N, vector<ld>(N, 0.0));
  fore(i, 0, N) nk[i][0] = nk[i][i] = 1.0;
  fore(i, 1, N) fore(j, 1, i) nk[i][j] = nk[i - 1][j - 1] + nk[i - 1][j];
}

lli gcd(lli a, lli b) { return (b ? gcd(b, a % b) : a); }

lli lcm(lli a, lli b) {
  if (a < b)
    swap(a, b);
  lli c = gcd(a, b);
  a /= c;
  return a * b;
}

int popcount(lli x) { return __builtin_popcountll(x); }

lli poww(lli a, lli b) {
  lli res = 1;
  while (b) {
    if (b & 1)
      res = res * a;
    a = a * a;
    b /= 2;
  }
  return res;
}

lli powm(lli a, lli b) {
  lli res = 1;
  while (b) {
    if (b & 1)
      res = (res * a) % MOD;
    a = (a * a) % MOD;
    b /= 2;
  }
  return res;
}

bool isPrime(lli x) {
  if (x == 1)
    return 0;
  for (auto i : primes) {
    if (i * i > x)
      return 1;
    if (x % i == 0)
      return 0;
  }
  return 1;
}

lli SUM(lli a, lli b, lli mod = MOD) { return (a + b + mod) % mod; }

lli PROD(lli a, lli b, lli mod = MOD) {
  a %= mod;
  b %= mod;
  return a * b % mod;
}

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

vvi graph(int n, int m) {
  vv(int, v, n + 1, 0);
  fore(i, 0, m) {
    int a, b;
    cin >> a >> b;
    v[a].pb(b);
    v[b].pb(a);
  }
  return v;
}

// ---- コーディングはここから！ ('-')7

void solve() {
  int n;
  cin >> n;
  vi dp(n + 1, 1);
  dp[0] = dp[1] = dp[2] = 0;
  fore(i, 2, n + 1) fore(j, 3, i) dp[i] = SUM(dp[i], dp[i - j]);
  cout << dp[n] << ENDL;
}
int main() {
  _
  // int t; cin>>t; while(t--)

  solve();
}


#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int mark[200003] = {};
int limit = 0;
int dp[200005] = {};
long long getSum(long long n) {
  if (dp[n] != -1 && n >= 0) {
    return dp[n];
  }
  if (n == 0) {
    return 1;
  }
  if (n < 0) {
    return 0;
  }
  long long res = 0;
  for (int i = 1; i <= limit; i++) {
    res = (res + getSum(n - mark[i])) % mod;
  }
  return dp[n] = res % mod;
}
void solve() {
  long long n;
  cin >> n;
  for (int i = 3; i <= n; i++) {
    limit++;
    mark[limit] = i;
  }
  long long sum = getSum(n) % mod;
  cout << sum << endl;
}
int main() {
  memset(dp, -1, sizeof(dp));
  solve();
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int mark[200003] = {};
int limit = 0;
long long dp[200005] = {};
long long getSum(long long n) {
  if (dp[n] != -1 && n >= 0) {
    return dp[n];
  }
  if (n == 0) {
    return 1;
  }
  if (n < 0) {
    return 0;
  }
  long long res = 0;
  for (int i = 1; i <= limit; i++) {
    if (n - mark[i] >= 0) {
      res = (res + getSum(n - mark[i])) % mod;
    }
  }
  return dp[n] = res % mod;
}
void solve() {
  long long n;
  cin >> n;
  for (int i = 3; i <= n; i++) {
    limit++;
    mark[limit] = i;
  }
  long long sum = getSum(n) % mod;
  cout << sum << endl;
}
int main() {
  memset(dp, -1, sizeof(dp));
  solve();
  return 0;
}


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

const ll mod = 1e9 + 7;
ll n, dp[777][2020], ans;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;

  dp[0][0] = 1;

  for (int i = 1; i <= n / 3 + 1; i++) {
    for (int j = i * 3; j <= n; j++) {
      for (int k = 0; k <= j - 3; k++) {
        (dp[i][j] += dp[i - 1][k]) %= mod;
      }
    }
  }

  for (int i = 1; i <= n / 3 + 1; i++)
    ans = (ans + dp[i][n]) % mod;

  cout << ans;
}

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

const ll mod = 1e9 + 7;
ll n, dp[777][2020], s[777][2020], ans;

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;

  dp[0][0] = s[0][0] = 1;

  for (int i = 1; i <= n / 3 + 1; i++) {
    for (int j = 1; j <= n; j++) {
      if (j >= 3)
        (dp[i][j] += s[i - 1][j - 3]) %= mod;
      s[i][j] = (s[i][j - 1] + dp[i][j]) % mod;
    }
  }

  for (int i = 1; i <= n / 3 + 1; i++)
    ans = (ans + s[i][n]) % mod;

  cout << ans;
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define S 8005
#define M 1000000007
#define nl cout << "\\n";
#define er cout << "\\n***********\\n";
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define test                                                                   \\
  lli t;                                                                       \\
  cin >> t;                                                                    \\
  while (t--)
#define all(x) (x).begin(), (x).end()
#define sz(x) (lli)(x.size())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define Y cout << "YES\\n";
#define N cout << "NO\\n";
#define print(x) cout << #x << ": " << x << endl;
#define print2(x, y)                                                           \\
  cout << #x << ": " << x << " | " << #y << ": " << y << endl;
#define print3(x, y, z)                                                        \\
  cout << #x << ":" << x << " | " << #y << ": " << y << " | " << #z << ": "    \\
       << z << endl;
#define print4(a, b, c, d)                                                     \\
  cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": "   \\
       << c << " | " << #d << ": " << d << endl;
#define print5(a, b, c, d, e)                                                  \\
  cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": "   \\
       << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define print6(a, b, c, d, e, f)                                               \\
  cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": "   \\
       << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | "   \\
       << #f << ": " << f << endl;

lli s;
lli dp[S][S];
void solve() {
  cin >> s;
  if (s <= 2) {
    cout << 0;
    return;
  }
  lli len = (s / 3);

  for (lli j = 3; j <= s; j++) {
    dp[1][j] = 1;
  }
  for (lli i = 2; i <= len; i++) {
    for (lli j = 3; j <= s; j++) {
      lli tp = 0;
      for (lli k = 3; (j - k) >= 0; k++) {
        tp = tp % M + (dp[i - 1][j - k]) % M;
        tp = tp % M;
      }
      dp[i][j] = tp;
    }
  }

  lli ans = 0;

  for (lli i = 1; i <= len; i++) {
    ans = ans % M + (dp[i][s]) % M;
    ans = ans % M;
  }

  cout << ans;
}

int main() {
  fast
#ifndef ONLINE_JUDGE
      freopen("inputa.txt", "r", stdin);
  freopen("outputa.txt", "w", stdout);
#endif
  // test
  {
    solve();
    nl
  }
}
// a+b=a?b+2?(a&b)
//__builtin_popcnt(number)
// cout<<fixed<<setprecision(8)<<output<<"\\n";

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
#define S 8005
#define M 1000000007
#define nl cout << "\\n";
#define er cout << "\\n***********\\n";
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define test                                                                   \\
  lli t;                                                                       \\
  cin >> t;                                                                    \\
  while (t--)
#define all(x) (x).begin(), (x).end()
#define sz(x) (lli)(x.size())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define Y cout << "YES\\n";
#define N cout << "NO\\n";
#define print(x) cout << #x << ": " << x << endl;
#define print2(x, y)                                                           \\
  cout << #x << ": " << x << " | " << #y << ": " << y << endl;
#define print3(x, y, z)                                                        \\
  cout << #x << ":" << x << " | " << #y << ": " << y << " | " << #z << ": "    \\
       << z << endl;
#define print4(a, b, c, d)                                                     \\
  cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": "   \\
       << c << " | " << #d << ": " << d << endl;
#define print5(a, b, c, d, e)                                                  \\
  cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": "   \\
       << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define print6(a, b, c, d, e, f)                                               \\
  cout << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": "   \\
       << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | "   \\
       << #f << ": " << f << endl;

lli s;
lli dp[S][S];
void solve() {
  cin >> s;
  if (s <= 2) {
    cout << 0;
    return;
  }
  lli len = (s / 3);

  for (lli j = 3; j <= s; j++) {
    dp[1][j] = 1;
  }
  for (lli i = 2; i <= len; i++) {
    for (lli j = 3; j <= s; j++) {
      dp[i][j] = (dp[i - 1][j - 3]) % M;
    }
    for (lli j = 3; j <= s; j++) {
      dp[i][j] = (dp[i][j] % M + dp[i][j - 1] % M) % M;
    }
  }

  lli ans = 0;

  for (lli i = 1; i <= len; i++) {
    ans = ans % M + (dp[i][s]) % M;
    ans = ans % M;
  }

  cout << ans;
}

int main() {
  fast
#ifndef ONLINE_JUDGE
      freopen("inputa.txt", "r", stdin);
  freopen("outputa.txt", "w", stdout);
#endif
  // test
  {
    solve();
    nl
  }
}
// a+b=a?b+2?(a&b)
//__builtin_popcnt(number)
// cout<<fixed<<setprecision(8)<<output<<"\\n";


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

int main() {
  int s;
  cin >> s;
  long long fib[s + 1];
  const int mod = 1e9 + 7;

  fib[0] = 0;
  fib[1] = 0;
  fib[2] = 0;
  fib[3] = 1;

  for (int i = 4; i <= s; ++i) {
    fib[i] = (fib[i - 1] + fib[i - 3]) % mod;
  }
  cout << fib[s];
  return 0;
}

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

int main() {
  int s;
  cin >> s;
  long long fib[s];
  const int mod = 1e9 + 7;
  fib[0] = 0;
  fib[1] = 0;
  fib[2] = 1;
  for (int i = 3; i < s; i++) {
    fib[i] = (fib[i - 1] + fib[i - 3]) % mod;
  }
  cout << fib[s - 1];
  return 0;
}


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

template <typename A, typename B> string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string &s) { return '"' + s + '"'; }

string to_string(const char *s) { return to_string((string)s); }

string to_string(bool b) { return (b ? "true" : "false"); }

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N> string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A> string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define fi first
#define se second
#define pb push_back
#define mod(n, k) ((((n) % (k)) + (k)) % (k))
#define forn(i, a, b) for (int i = a; i < b; i++)
#define forr(i, a, b) for (int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const ll mod = 1e9 + 7;
const int maxn = 1000;
const int maxs = 2001;
ll memo[maxn][maxs];

ll dp(int pos, int s) {
  if (s < 0)
    return 0;
  if (pos <= 0) {
    return (s == 0);
  }
  ll &res = memo[pos][s];
  if (res != -1)
    return res;
  res = 0;
  forn(i, 3, 10) {
    res += dp(pos - 1, s - i);
    res %= mod;
  }
  return res;
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  forn(i, 0, maxn) forn(j, 0, maxs) memo[i][j] = -1;
  int S;
  cin >> S;
  ll res = 0;
  forr(i, 1000, 1) {
    res += dp(i, S);
    // debug(i,dp(i,S));
    res %= mod;
  }
  if (res < 0)
    res += mod;
  cout << res << '\\n';

  return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/

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

template <typename A, typename B> string to_string(pair<A, B> p);

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);

string to_string(const string &s) { return '"' + s + '"'; }

string to_string(const char *s) { return to_string((string)s); }

string to_string(bool b) { return (b ? "true" : "false"); }

string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}

template <size_t N> string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}

template <typename A> string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ")";
}

template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " +
         to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define fi first
#define se second
#define pb push_back
#define mod(n, k) ((((n) % (k)) + (k)) % (k))
#define forn(i, a, b) for (int i = a; i < b; i++)
#define forr(i, a, b) for (int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define MAX 100000 + 10
#define MOD 1000000007

ll fac[MAX], caf[MAX]; // factorial e inverso

ll deg(ll x, ll d) {
  d %= MOD - 1;
  if (d < 0)
    d += MOD - 1;
  ll y = 1;
  while (d) {
    if (d & 1)
      y *= x, y %= MOD;
    x *= x, x %= MOD;
    d /= 2;
  }
  return y;
}
ll coeff(int n, int k) { return fac[n] * caf[k] % MOD * caf[n - k] % MOD; }

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  fac[0] = caf[0] = 1;
  forn(i, 1, MAX) fac[i] = i * fac[i - 1] % MOD, caf[i] = deg(fac[i], -1);
  int S;
  cin >> S;
  ll res = 0;

  forn(i, 1, 2000) {
    int Sp = S - 3 * i;
    if (Sp < 0)
      break;
    ll add = coeff(i + Sp - 1, i - 1);
    res = ((res % MOD) + (add % MOD)) % MOD;
  }
  if (res < 0)
    res += MOD;
  cout << res << '\\n';

  return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    pbds;

const int N = 2010;
long long mod = 1e9 + 7;
long long cache[N][N];
long long s;

long long dp(int ind, long long num) {
  if (num > s || ind >= N)
    return 0;
  if (num == s)
    return 1;

  long long &ans = cache[ind][num];
  if (ans != -1)
    return ans;

  ans = 0;
  for (long long nnum = 3; nnum <= s; nnum++) {
    if (nnum + num <= s)
      ans = (ans + dp(ind + 1, num + nnum)) % mod;
    else
      break;
  }

  return ans % mod;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> s;
  memset(cache, -1, sizeof(cache));

  long long ans = dp(0, 0);
  cout << ans;

  return 0;
}

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    pbds;

const int N = 2010;
long long mod = 1e9 + 7;
long long cache[N];
long long s;

long long dp(long long num) {
  if (num > s)
    return 0;
  if (num == s)
    return 1;

  long long &ans = cache[num];
  if (ans != -1)
    return ans;

  ans = 0;
  for (long long nnum = 3; nnum <= s; nnum++) {
    if (nnum + num <= s)
      ans = (ans + dp(num + nnum)) % mod;
    else
      break;
  }

  return ans % mod;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> s;
  memset(cache, -1, sizeof(cache));

  long long ans = dp(0);
  cout << ans;

  return 0;
}


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

int main() {
  int s;
  cin >> s;
  vector<int> F(s, 0);
  for (int i = 3; i <= s; ++i) {
    F[i] = 1;
  }
  int mod = 1e9 + 7;
  for (int i = 5; i <= s; ++i) {
    for (int j = 0; j < i; ++j) {
      if (j >= 3 && i - j >= 3) {
        F[i] = (F[i] + F[j]) % mod;
      }
    }
  }
  cout << F[s] << endl;
  return 0;
}

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

int main() {
  int s;
  cin >> s;
  vector<int> F(s + 1, 0);
  for (int i = 3; i <= s; ++i) {
    F[i] = 1;
  }
  int mod = 1e9 + 7;
  for (int i = 1; i <= s; ++i) {
    for (int j = 0; j < i; ++j) {
      if (j >= 3 && i - j >= 3) {
        F[i] = (F[i] + F[j]) % mod;
      }
    }
  }
  cout << F[s] << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int mark[2003] = {};
int limit = 0;
long long dp[2005] = {};
int getSum(int n) {
  if (dp[n] != -1 && n >= 0) {
    return dp[n];
  }
  if (n == 0) {
    // cout << n << endl;
    // cout << Count << endl;
    // Count++;
    return 1;
  }
  if (n < 0) {
    return 0;
  }
  int res = 0;
  for (int i = 1; i <= limit; i++) {
    // cout << mark[i] << endl;
    int tt = n - mark[i];
    if (tt >= 0) {
      res = (res + getSum(tt)) % mod;
    }
  }
  // cout << n << " " << res << endl;
  dp[n] = res % mod;
}
void solve() {
  int n;
  cin >> n;
  for (int i = 3; i <= n; i++) {
    limit++;
    mark[limit] = i;
  }
  // cout << limit << endl;
  long long sum = getSum(n) % mod;
  cout << sum << endl;
}
int main() {
  memset(dp, -1, sizeof(dp));
  solve();
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int mark[20003] = {};
int limit = 0;
int dp[200005] = {};
long long getSum(int n) {
  if (dp[n] != -1 && n >= 0) {
    return dp[n];
  }
  if (n == 0) {
    // cout << n << endl;
    // cout << Count << endl;
    // Count++;
    return 1;
  }
  if (n < 0) {
    return 0;
  }
  long long res = 0;
  for (int i = 1; i <= limit; i++) {
    // cout << mark[i] << endl;
    int tt = n - mark[i];
    if (tt >= 0) {
      res = (res + getSum(tt)) % mod;
    }
  }
  // cout << n << " " << res << endl;
  return dp[n] = res % mod;
}
void solve() {
  long long n;
  cin >> n;
  for (int i = 3; i <= n; i++) {
    limit++;
    mark[limit] = i;
  }
  // cout << limit << endl;
  long long sum = getSum(n) % mod;
  cout << sum << endl;
}
int main() {
  memset(dp, -1, sizeof(dp));
  solve();
  return 0;
}


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

template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;

const int MOD = 1000000007;

// modint: mod 計算を int を扱うように扱える構造体
template <int MOD> struct Fp {
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
    if (val < 0)
      val += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator-() const noexcept { return val ? MOD - val : 0; }
  constexpr Fp operator+(const Fp &r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator-(const Fp &r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator*(const Fp &r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator/(const Fp &r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp &operator+=(const Fp &r) noexcept {
    val += r.val;
    if (val >= MOD)
      val -= MOD;
    return *this;
  }
  constexpr Fp &operator-=(const Fp &r) noexcept {
    val -= r.val;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr Fp &operator*=(const Fp &r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp &operator/=(const Fp &r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr bool operator==(const Fp &r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator!=(const Fp &r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream &operator<<(ostream &os, const Fp<MOD> &x) noexcept {
    return os << x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
    if (n == 0)
      return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1)
      t = t * a;
    return t;
  }
};

using mint = Fp<MOD>;
const int MAX = 510000;

mint dp[2005][680];
int s;

mint f(int a, int l) {
  if (dp[a][l] != -1)
    return dp[a][l];
  if (l * 3 > a)
    return dp[a][l] = 0;
  if (l * 3 == a)
    return dp[a][l] = 1;
  if (l == 1)
    return dp[a][l] = 1;
  mint res = 0;
  for (int i = 3; a - i >= 3; i++) {
    res += f(a - i, l - 1);
  }
  return dp[a][l] = res;
}

int main() {
  cin >> s;
  rep(i, 2005) rep(j, 680) dp[i][j] = -1;
  mint res = 0;
  // rep1(j,s/3)
  for (int j = s / 3; j > 0; j--) {
    mint tmp = f(s, j);
    res += tmp;
    if (tmp == 0)
      break;
  }
  cout << res << endl;
}

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

template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 10000000000
#define MOD 1000000007
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;

int s;
vector<ll> dp;

ll f(int a) {
  if (dp[a] != -1)
    return dp[a];
  if (a < 3)
    return dp[a] = 0;
  if (a < 6)
    return dp[a] = 1;
  ll res = 0;
  res += f(a - 1);
  res %= MOD;
  res += f(a - 3);
  res %= MOD;
  return dp[a] = res;
}

int main() {
  cin >> s;
  dp.resize(s + 10);
  rep(i, s + 10) dp[i] = -1;
  cout << f(s) << endl;
}


#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <vector>

#define reps(i, s, n) for (int(i) = (s); (i) < (n); (i)++)
#define rep(i, n) reps(i, 0, n)
using namespace std;
using ll = long long;

ll dp[2000][701];
ll mod = 1e9 + 7;

int main() {
  rep(i, 2000) {
    rep(j, 701) { dp[i][j] = 0; }
  }
  dp[3][1] = 1;

  int s;
  cin >> s;
  reps(i, 4, 2000) {
    rep(j, 701) {
      dp[i][j] = dp[i - 1][j];
      if (i - 3 >= 0 && j >= 1)
        dp[i][j] = (dp[i][j] + dp[i - 3][j - 1]) % mod;
    }
  }

  ll ans = 0;
  rep(i, 700) { ans = (ans + dp[s][i]) % mod; }

  cout << ans << endl;
  return 0;
}

#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <vector>

#define reps(i, s, n) for (int(i) = (s); (i) < (n); (i)++)
#define rep(i, n) reps(i, 0, n)
using namespace std;
using ll = long long;

ll dp[2010][710];
ll mod = 1e9 + 7;

int main() {
  rep(i, 2010) {
    rep(j, 710) { dp[i][j] = 0; }
  }
  dp[3][1] = 1;

  int s;
  cin >> s;
  reps(i, 4, 2010) {
    rep(j, 701) {
      dp[i][j] = dp[i - 1][j];
      if (i - 3 >= 0 && j >= 1)
        dp[i][j] = (dp[i][j] + dp[i - 3][j - 1]) % mod;
    }
  }

  ll ans = 0;
  rep(i, 700) { ans = (ans + dp[s][i]) % mod; }

  cout << ans << endl;
  return 0;
}


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> p;
typedef long long ll;
const int inf = 1000000007;

int main() {
  int s;
  cin >> s;
  vector<ll> dp(s + 1, 0);
  rep(i, 3) {
    dp[i] = 0;
    dp[i + 3] = 1;
  }
  rep(i, s + 1) {
    if (0 <= i && i <= 5)
      continue;
    dp[i] = (dp[i - 1] + dp[i - 3]) % inf;
  }
  cout << dp[s] << endl;
  return 0;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> p;
typedef long long ll;
const int inf = 1000000007;

int main() {
  int s;
  cin >> s;
  if (s >= 0 && s <= 2) {
    cout << 0 << endl;
    return 0;
  }
  if (s >= 3 && s <= 5) {
    cout << 1 << endl;
    return 0;
  }
  vector<ll> dp(s + 1, 0);
  rep(i, 3) {
    dp[i] = 0;
    dp[i + 3] = 1;
  }
  rep(i, s + 1) {
    if (0 <= i && i <= 5)
      continue;
    dp[i] = (dp[i - 1] + dp[i - 3]) % inf;
  }
  cout << dp[s] << endl;
  return 0;
}


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

int main() {
  ll int s;
  cin >> s;
  ll int dp[s + 1];
  dp[0] = 0, dp[1] = 0, dp[2] = 0, dp[3] = 1;
  for (ll int i = 4; i <= s; i++) {
    dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007;
  }
  cout << dp[s];
  return 0;
}

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

int main() {
  ll int s;
  cin >> s;
  ll int dp[s];
  dp[0] = 0, dp[1] = 0, dp[2] = 1;
  for (ll int i = 3; i < s; i++) {
    dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007;
  }
  cout << dp[s - 1];
  return 0;
}