#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
// vector<vector<ll>> data(3, vector<ll>(4));
// vector<ll> data(N);
// str s = to_string(i);
// int i = c - '0'
// sort(data.begin(), data.end());
// reverse(data.begin(), data.end());
// data.erase(unique(data.begin(), data.end()), data.end());
// str.substr(n)//n番以降スライス
// str.substr(n,m)//n番以降m文字スライス
// str.erase(n)//n番以降削除
// str.erase(n,m)//n番以降m文字削除
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define FORD(i, a, b) for (ll i = ll(a); i >= ll(b); i--)
#define PB push_back
#define MOD 1000000007
using namespace std;

int main() {
  ll N;
  ll s;
  cin >> N;

  vector<ll> data(N + 1);
  data.at(0) = 1;
  data.at(1) = 0;
  data.at(2) = 0;
  FOR(i, 3, N + 1) {
    data.at(i) = data.at(i - 1) + data.at(i - 3);
    data.at(i) %= MOD;
  }
  if (data.at(N) % MOD >= 0)
    data.at(N) = data.at(N) % MOD;
  else
    data.at(N) = data.at(N) % MOD + MOD;
  cout << data.at(N) << endl;
}

#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
// vector<vector<ll>> data(3, vector<ll>(4));
// vector<ll> data(N);
// str s = to_string(i);
// int i = c - '0'
// sort(data.begin(), data.end());
// reverse(data.begin(), data.end());
// data.erase(unique(data.begin(), data.end()), data.end());
// str.substr(n)//n番以降スライス
// str.substr(n,m)//n番以降m文字スライス
// str.erase(n)//n番以降削除
// str.erase(n,m)//n番以降m文字削除
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define FORD(i, a, b) for (ll i = ll(a); i >= ll(b); i--)
#define PB push_back
#define MOD 1000000007
using namespace std;

int main() {
  ll N;
  cin >> N;

  vector<ll> data(N + 1);
  data.at(0) = 1;
  data.at(1) = 0;
  if (N >= 2)
    data.at(2) = 0;
  if (N >= 3) {
    FOR(i, 3, N + 1) {
      data.at(i) = data.at(i - 1) + data.at(i - 3);
      data.at(i) %= MOD;
    }
  }
  if (data.at(N) % MOD >= 0)
    data.at(N) = data.at(N) % MOD;
  else
    data.at(N) = data.at(N) % MOD + MOD;
  cout << data.at(N) << endl;
}


/*----- || Hare Krishna || -----*/

/*  "WHY DO WE FALL, BRUCE?"  */

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#define ll long long
#define endl '\\n'
#define elif else if
#define pb push_back
#define pf push_front
#define PI 3.1415926535897932384
#define MOD 1000000007
using namespace std;

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                  's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

int t;

ll S;

ll dp[2001][2001];

ll solve(ll idx, ll prev_sum) {
  //	cout << idx << ' ' << prev_sum << endl;
  if (prev_sum == S) {
    return 1;
  }
  if (prev_sum > S) {
    return 0;
  }
  if (dp[idx][prev_sum] != -1) {
    return dp[idx][prev_sum];
  }

  ll ans = 0;

  for (int i = 3; i <= S; i++) {
    ans += (solve(idx + 1, prev_sum + i) + MOD) % MOD;
  }

  return dp[idx][prev_sum] = (ans + MOD) % MOD;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);

  cin >> S;
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0);
}

/*----- || Hare Krishna || -----*/

/*  "WHY DO WE FALL, BRUCE?"  */

// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
#define ll long long
#define endl '\\n'
#define elif else if
#define pb push_back
#define pf push_front
#define PI 3.1415926535897932384
#define MOD 1000000007
using namespace std;

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                  's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

int t;

ll S;

ll dp[2001];

ll solve(ll idx, ll prev_sum) {

  if (prev_sum == S) {
    return 1;
  }
  if (prev_sum > S) {
    return 0;
  }
  if (dp[prev_sum] != -1) {
    return dp[prev_sum];
  }
  //	cout << idx << ' ' <<prev_sum << endl;
  ll ans = 0;

  for (int i = 3; i <= S; i++) {
    ans += (solve(idx + 1, prev_sum + i) + MOD) % MOD;
  }

  return dp[prev_sum] = (ans + MOD) % MOD;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);

  cin >> S;
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0);
}


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

const int MOD = 1000000007;

int main() {
  ll s;
  cin >> s;
  ll dp[s + 1];              // oooo|ooooooo i番目の右に仕切り
  dp[0] = dp[1] = dp[2] = 0; // 数列なし
  dp[3] = dp[4] = dp[5] = 1; // 数列はひとつだけ(仕切りが右端)
  dp[6] = dp[3] + 1;
  // dp[7] = dp[4] + dp[3] = dp[4] + dp[6];
  // dp[8] = dp[5] + dp[4] + dp[3] = dp[5] + dp[7];
  // dp[n] = dp[n-3] + dp[n-1];
  if (s >= 7) {
    for (int i = 7; i <= s; i++) {
      dp[i] = dp[i - 3] + dp[i - 1];
      dp[i] %= MOD;
    }
  }

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

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

const int MOD = 1000000007;

int main() {
  ll s;
  cin >> s;
  ll dp[2001];               // oooo|ooooooo i番目の右に仕切り
  dp[0] = dp[1] = dp[2] = 0; // 数列なし
  dp[3] = dp[4] = dp[5] = 1; // 数列はひとつだけ(仕切りが右端)
  dp[6] = dp[3] + 1;
  // dp[7] = dp[4] + dp[3] = dp[4] + dp[6];
  // dp[8] = dp[5] + dp[4] + dp[3] = dp[5] + dp[7];
  // dp[n] = dp[n-3] + dp[n-1];
  if (s >= 7) {
    for (int i = 7; i <= s; i++) {
      dp[i] = dp[i - 3] + dp[i - 1];
      dp[i] %= MOD;
    }
  }

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


#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 1; i <= n; ++i)
#define all(x) begin(x), end(x)
#define show(obj)                                                              \\
  {                                                                            \\
    for (auto x : obj)                                                         \\
      cout << x << ' ';                                                        \\
    cout << endl;                                                              \\
  }
#define line "----------"
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
const int inf = 1001001000;
const ll INF = 1LL << 60;
const int MOD = (int)1e9 + 7;

int main() {
  int S;
  cin >> S;
  vector<vector<ll>> dp(S + 1, vector<ll>(700, 0));
  ll ans = 0;
  for (int i = 3; i < 2000; ++i) {
    dp[i][0] = 1;
  }
  for (int i = 0; i < 2000; ++i) {
    for (int k = 3; k < 2000; ++k) {
      if (i + k <= 2000)
        dp[i + 1][k + i] += dp[i][k];
      dp[i + 1][k + i] %= MOD;
    }
  }
  cout << dp[S][S] << endl;
  return 0;
}

#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 1; i <= n; ++i)
#define all(x) begin(x), end(x)
#define show(obj)                                                              \\
  {                                                                            \\
    for (auto x : obj)                                                         \\
      cout << x << ' ';                                                        \\
    cout << endl;                                                              \\
  }
#define line "----------"
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
const int inf = 1001001000;
const ll INF = 1LL << 60;
const int MOD = (int)1e9 + 7;

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


#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; --i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define P pair<int, int>
#define optimize_cin()                                                         \\
  cin.tie(0);                                                                  \\
  ios::sync_with_stdio(false)
using namespace std;
using ll = long long;
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

static const ll mod = 1000000007LL;

const int MAX = 700;
ll 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;
  }
}

ll 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;

  if (s <= 2) {
    cout << 0 << endl;
    return 0;
  }

  COMinit();

  int num = s / 3;
  ll ans = 0;
  reps(i, num) { ans = (ans + com(s - 2 * i - 1, i - 1)) % mod; }

  cout << ans << endl;
}

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; --i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define P pair<int, int>
#define optimize_cin()                                                         \\
  cin.tie(0);                                                                  \\
  ios::sync_with_stdio(false)
using namespace std;
using ll = long long;
template <class T> bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T> bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

static const ll mod = 1000000007LL;

const int MAX = 10000;
ll 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;
  }
}

ll 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;

  if (s <= 2) {
    cout << 0 << endl;
    return 0;
  }

  COMinit();

  int num = s / 3;
  ll ans = 0;
  reps(i, num) { ans = (ans + com(s - 2 * i - 1, i - 1)) % mod; }

  cout << ans << endl;
}


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

#define mp make_pair
#define pb push_back
#define ll long long int
#define sd(x) scanf("%lld", &x)
#define inf 1e18 + 9
#define pll pair<ll, ll>
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define bits(x) __builtin_popcountll(x)
#define ld long double
#define test()                                                                 \\
  ll test;                                                                     \\
  cin >> test;                                                                 \\
  while (test--)
#define fi first
#define se second

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\\'' << x << '\\''; }
void __print(const char *x) { cerr << '\\"' << x << '\\"'; }
void __print(const string &x) { cerr << '\\"' << x << '\\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V> void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T> void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x)
    cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\\n"; }
template <typename T, typename... V> void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v))
    cerr << ", ";
  _print(v...);
}
#ifndef ONLINE_JUDGE
#define debug(x...)                                                            \\
  cerr << "[" << #x << "] = [";                                                \\
  _print(x)
#else
#define debug(x...)
#endif

inline ll GCD(ll x, ll y) {
  if (x < y)
    swap(x, y);
  if (x == 0)
    return y;
  if (y == 0)
    return x;
  return GCD(x % y, y);
}

ll phi(ll n) {
  ll result = n;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0)
        n /= i;
      result -= result / i;
    }
  }
  if (n > 1)
    result -= result / n;
  return result;
}

ll power(ll x, ll n, ll mod) {
  ll res = 1;
  x = (x + mod) % mod;
  while (n) {
    if (n & 1) {
      res = ((res * x) % mod + mod) % mod;
    }
    x = ((x * x) % mod + mod) % mod;
    n >>= 1;
  }

  return res;
}

const ll MOD = 1e9 + 7;
const int MAXN = 2005;

inline ll add(ll x, ll y) {
  x = (x + MOD) % MOD;
  y = (y + MOD) % MOD;
  ll ans = (x + y + MOD) % MOD;
  return ans;
}

ll dp[MAXN][MAXN] = {0};
ll S;

void clear() {
  for (ll i = 0; i < MAXN; i++) {
    for (ll j = 0; j < MAXN; j++) {
      dp[i][j] = -1;
    }
  }
}

ll solve(ll indx, ll sum) {
  if (sum == 0)
    return 1;
  if (sum <= 2 && sum >= 1) {
    return 0;
  }

  if (dp[indx][sum] != -1)
    return dp[indx][sum];

  ll ans = 0;

  for (ll i = 3; i <= S; i++) {
    if (sum - i >= 0) {
      ans = (ans + solve(indx + 1, sum - i)) % MOD;
    } else
      break;
  }

  return dp[indx][sum] = ans;
}

int main() {
  fastio;

  // ll S;
  cin >> S;
  clear();

  ll ans = solve(1, S);

  cout << ans << endl;
}

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

#define mp make_pair
#define pb push_back
#define ll long long int
#define sd(x) scanf("%lld", &x)
#define inf 1e18 + 9
#define pll pair<ll, ll>
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define bits(x) __builtin_popcountll(x)
#define ld long double
#define test()                                                                 \\
  ll test;                                                                     \\
  cin >> test;                                                                 \\
  while (test--)
#define fi first
#define se second

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\\'' << x << '\\''; }
void __print(const char *x) { cerr << '\\"' << x << '\\"'; }
void __print(const string &x) { cerr << '\\"' << x << '\\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V> void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T> void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x)
    cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\\n"; }
template <typename T, typename... V> void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v))
    cerr << ", ";
  _print(v...);
}
#ifndef ONLINE_JUDGE
#define debug(x...)                                                            \\
  cerr << "[" << #x << "] = [";                                                \\
  _print(x)
#else
#define debug(x...)
#endif

inline ll GCD(ll x, ll y) {
  if (x < y)
    swap(x, y);
  if (x == 0)
    return y;
  if (y == 0)
    return x;
  return GCD(x % y, y);
}

ll phi(ll n) {
  ll result = n;
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0)
        n /= i;
      result -= result / i;
    }
  }
  if (n > 1)
    result -= result / n;
  return result;
}

ll power(ll x, ll n, ll mod) {
  ll res = 1;
  x = (x + mod) % mod;
  while (n) {
    if (n & 1) {
      res = ((res * x) % mod + mod) % mod;
    }
    x = ((x * x) % mod + mod) % mod;
    n >>= 1;
  }

  return res;
}

const ll MOD = 1e9 + 7;
const int MAXN = 2005;

inline ll add(ll x, ll y) {
  x = (x + MOD) % MOD;
  y = (y + MOD) % MOD;
  ll ans = (x + y + MOD) % MOD;
  return ans;
}

ll dp[MAXN][MAXN] = {0};
ll S;

ll dp2[MAXN] = {0};

void clear() {
  for (ll i = 0; i < MAXN; i++) {
    for (ll j = 0; j < MAXN; j++) {
      dp[i][j] = 0;
    }
  }

  for (ll i = 3; i < MAXN; i++) {
    dp[1][i] = 1;
  }
}

ll solve(ll indx, ll sum) {
  if (sum == 0)
    return 1;
  if (sum <= 2 && sum >= 1) {
    return 0;
  }

  if (dp[indx][sum] != -1)
    return dp[indx][sum];

  ll ans = 0;

  for (ll i = 3; i <= S; i++) {
    if (sum - i >= 0) {
      ans = (ans + solve(indx + 1, sum - i)) % MOD;
    } else
      break;
  }

  return dp[indx][sum] = ans;
}

inline ll mul(ll x, ll y) {
  x %= MOD;
  y %= MOD;
  ll ans = ((x * y) % MOD + MOD) % MOD;
  return ans;
}

int main() {
  fastio;

  // ll S;
  cin >> S;
  clear();

  if (S <= 2) {
    cout << 0 << endl;
    return 0;
  }

  dp2[0] = 1;
  dp2[3] = 1;

  for (ll i = 4; i <= S; i++) {
    for (ll k = 3; k <= S; k++) {
      if (i - k >= 0)
        dp2[i] = (dp2[i] + dp2[i - k]) % MOD;
      else
        break;
    }
  }

  cout << dp2[S] << endl;

  // ll ans = solve(1,S);

  // ll ans = 0;

  // for(ll i=2;(i*3)<=S;i++) {
  //     for(ll j=3;j<=S;j++) {
  //         for(ll k=3;k<=S;k++) {
  //             if(j-k>0) {
  //                 dp[i][j] = (dp[i][j]+dp[i-1][j-k])%MOD;
  //             } else break;
  //         }
  //     }
  // }

  // for(ll i=1;i*3<=S;i++) {
  //     ans = (ans+dp[i][S])%MOD;
  // }

  // cout<<ans<<endl;
}


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

long long ans = 0;

void done(int n) {
  if (n < 0) {
    return;
  }
  if (n == 0) {
    ans = ((1 + ans) % m);
  }
  for (int i = 3; i <= 9; i++) {
    done(n - i);
  }
}

int main() {
  int n;
  cin >> n;
  ans = 0;
  done(n);
  cout << ans << endl;
}

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

long long dp[2005];

long long done(int n) {
  if (n < 0) {
    return 0;
  }
  if (n == 0) {
    return 1;
  }
  if (dp[n] != -1)
    return dp[n];
  long long ans = 0;
  for (int i = 3; i <= n; i++) {
    ans += done(n - i);
  }
  dp[n] = (ans % m);
  return (ans % m);
}

int main() {
  int n;
  cin >> n;
  memset(dp, -1, sizeof(dp));
  cout << done(n) << endl;
}


#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int S;
long long mod = 1000000007;
int func(int x) {

  if (x == 3 || x == 4 || x == 5) {
    return 1;
  } else if (x < 3) {
    return 0;
  } else if (x == 6) {
    return 2;
  } else if (x == 7) {
    return 3;
  } else if (x == 8) {
    return 4;
  } else if (x == 9) {
    return 6;
  } else if (x == 10) {
    return 9;
  } else if (x == 11) {
    return 13;
  } else if (x == 12) {
    return 18;
  }

  long long ans = 0;
  /*
  for(int i = 3; i <= x-3; ++i){
      //ans += func(i)%mod * func(x-i)%mod;
      ans += func(i)%mod;
  }
  */
  ans = func(x - 1) % mod + func(x - 3) % mod;

  // ans *=2;
  // return ans+1;
  return ans;
}

int main() {
  cin >> S;

  long long ans = 0;
  if (S <= 2) {
    cout << 0 << endl;
    return 0;
  }
  ans = func(S);
  cout << ans << endl;
  /*
  for(int i = 3; i < S-3; ++i){

      ans += func(i)%mod * func(S-i)%mod;

  }
  */

  return 0;
}

#include <algorithm>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

template <class T> inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int S;
long long mod = 1000000007;
long long arr[2001];
int func(int x) {

  if (x == 3 || x == 4 || x == 5) {
    return 1;
  } else if (x < 3) {
    return 0;
  } else if (x == 6) {
    return 2;
  } else if (x == 7) {
    return 3;
  } /*
   else if(x == 8){
       return 4;
   }
   else if(x == 9){
       return 6;
   }
   else if(x == 10){
       return 9;
   }
   else if (x == 11){
       return 13;
   }
   else if (x == 12){
       return 18;
   }
   */
  long long ans = 0;
  /*
  for(int i = 3; i <= x-3; ++i){
      //ans += func(i)%mod * func(x-i)%mod;
      ans += func(i)%mod;
  }
  */
  // ans = func(x-1)%mod + func(x-3)%mod;
  ans = arr[x - 1] % mod + arr[x - 3] % mod;
  // ans *=2;
  // return ans+1;
  return ans % mod;
}

int main() {
  cin >> S;

  long long ans = 0;
  if (S <= 2) {
    cout << 0 << endl;
    return 0;
  }
  // ans  = func(S);

  /*
  for(int i = 3; i < S-3; ++i){

      ans += func(i)%mod * func(S-i)%mod;

  }
  */

  for (int i = 1; i <= S; ++i) {
    arr[i] = func(i);
  }
  cout << arr[S] << endl;
  return 0;
}


/* Generated by cf-tool.
 * You can download the binary file in here:
 * https://github.com/xalanq/cf-tool (Windows, macOS, Linux)
 * Author: $%U%$
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
 **/

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

template <typename T = double> using point = complex<T>; // 2D point only

using ll = long long;
using ull = unsigned long long;

using ii = pair<int, int>;
using iii = pair<int, ii>;
using ii_i = pair<ii, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using viii = vector<iii>;
template <typename T = int> using lim = numeric_limits<T>;

#ifdef _DEBUG
#define debug_text(...) printf(__VA_ARGS__)
#else
#define debug_text(...) /* --- NOTHING --- */
#endif

#define re real()
#define im imag()
#define fi first
#define se second
#define sz(v) (v).size()
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

// OST
template <typename T>
using ordered_set = __gnu_pbds::tree<T, null_type, less<T>, rb_tree_tag,
                                     tree_order_statistics_node_update>;

// from: https://codeforces.com/blog/entry/62393
// struct custom_hash {
// 	static uint64_t splitmix64(uint64_t x) {
// 		// http://xorshift.di.unimi.it/splitmix64.c
// 		x += 0x9e3779b97f4a7c15;
// 		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
// 		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
// 		return x ^ (x >> 31);
// 	}

// 	size_t operator()(uint64_t x) const {
// 		static const uint64_t FIXED_RANDOM =
// chrono::steady_clock::now().time_since_epoch().count(); 		return splitmix64(x +
// FIXED_RANDOM);
// 	}
// };

const int INF = ~(1 << 31);
const ll LINF = (1LL << 60);
const long double EPS = 1e-9;
const long double PI = acos(-1);

const int N = 2005;
const int M = 1 << 19;
const int MOD = 1e9 + 7; // 998244353;
const int MOD2 = 1e9 + 9;
const int IMAX = 1e9 + 7;
const ll LMOD = 1LL << 59;
const ll LMAX = 1e16 + 7;
const ll P = 131;
const ll P2 = 151;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};
const int dx8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dy8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

ll s, dp[N][N];

ll solve(int pos, int x) {
  if (x == 0)
    return 1;
  if (0 < x and x < 3)
    return 0;
  ll &ans = dp[pos][x];
  if (ans != -1)
    return ans;
  ans = 0;
  for (int i = 3; i <= x; ++i) {
    (ans += solve(pos + 1, x - i)) %= MOD;
  }
  return ans;
}

void solution() {
  cin >> s;
  cout << solve(0, s) << endl;
}

void pregen() {}

void prepare() {
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      dp[i][j] = -1;
    }
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0); // cout.tie(0);
  // cout.precision(2); cout << fixed;

  int T = 1;
  // cin >> T;
  pregen();
  for (int i = 1; i <= T; ++i) {
    prepare();
    solution();
  }

  return 0;
}

/* Generated by cf-tool.
 * You can download the binary file in here:
 * https://github.com/xalanq/cf-tool (Windows, macOS, Linux)
 * Author: $%U%$
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
 **/

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

template <typename T = double> using point = complex<T>; // 2D point only

using ll = long long;
using ull = unsigned long long;

using ii = pair<int, int>;
using iii = pair<int, ii>;
using ii_i = pair<ii, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using viii = vector<iii>;
template <typename T = int> using lim = numeric_limits<T>;

#ifdef _DEBUG
#define debug_text(...) printf(__VA_ARGS__)
#else
#define debug_text(...) /* --- NOTHING --- */
#endif

#define re real()
#define im imag()
#define fi first
#define se second
#define sz(v) (v).size()
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

// OST
template <typename T>
using ordered_set = __gnu_pbds::tree<T, null_type, less<T>, rb_tree_tag,
                                     tree_order_statistics_node_update>;

// from: https://codeforces.com/blog/entry/62393
// struct custom_hash {
// 	static uint64_t splitmix64(uint64_t x) {
// 		// http://xorshift.di.unimi.it/splitmix64.c
// 		x += 0x9e3779b97f4a7c15;
// 		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
// 		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
// 		return x ^ (x >> 31);
// 	}

// 	size_t operator()(uint64_t x) const {
// 		static const uint64_t FIXED_RANDOM =
// chrono::steady_clock::now().time_since_epoch().count(); 		return splitmix64(x +
// FIXED_RANDOM);
// 	}
// };

const int INF = ~(1 << 31);
const ll LINF = (1LL << 60);
const long double EPS = 1e-9;
const long double PI = acos(-1);

const int N = 2005;
const int M = 1 << 19;
const int MOD = 1e9 + 7; // 998244353;
const int MOD2 = 1e9 + 9;
const int IMAX = 1e9 + 7;
const ll LMOD = 1LL << 59;
const ll LMAX = 1e16 + 7;
const ll P = 131;
const ll P2 = 151;
const int dx[4] = {0, 0, -1, 1};
const int dy[4] = {-1, 1, 0, 0};
const int dx8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const int dy8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

ll s, dp[N];

ll solve(int x) {
  if (x == 0)
    return 1;
  if (x < 3)
    return 0;
  ll &ans = dp[x];
  if (ans != -1)
    return ans;
  ans = 0;
  for (int i = 3; i <= x; ++i) {
    (ans += solve(x - i)) %= MOD;
  }
  return ans;
}

void solution() {
  cin >> s;
  cout << solve(s) << endl;
}

void pregen() {}

void prepare() {
  for (int i = 0; i < N; ++i) {
    dp[i] = -1;
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0); // cout.tie(0);
  // cout.precision(2); cout << fixed;

  int T = 1;
  // cin >> T;
  pregen();
  for (int i = 1; i <= T; ++i) {
    prepare();
    solution();
  }

  return 0;
}


#include <bits/stdc++.h>

#define rep(X, N) for (ll X = 0LL; X < (N); X++)
#define ALL(V) (V).begin(), (V).end()
#define endl "\\n"

using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

const double PI = 3.1415926535897932384626;
const ll MODN = 1000000007;
const ll MODN2 = 998244353;

long long gcd(long long a, long long b) {
  if (a < b)
    swap(a, b);
  assert(b != 0);
  if (a % b == 0)
    return b;
  return gcd(b, a % b);
}

class ModInt {
  int _mod;
  long long x;

public:
  ModInt() {}
  ModInt(long long _x, int m) {
    _mod = m;
    x = _x % m;
    if (x < 0)
      x += m;
  }

  int val() { return (int)x; }

  int mod() { return _mod; }

  ModInt &operator++() {
    x++;
    if (x == _mod)
      x = 0;
    return *this;
  }

  ModInt &operator--() {
    if (x == 0)
      x = _mod;
    x--;
    return *this;
  }

  ModInt &operator+=(const ModInt &rhs) {
    x += rhs.x;
    if (x >= _mod)
      x -= _mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &rhs) {
    x -= rhs.x;
    if (x < 0)
      x += _mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &rhs) {
    x *= rhs.x;
    if (x >= _mod)
      x = x % _mod;
    return *this;
  }

  ModInt operator+() const { return *this; }

  ModInt operator-() const { return ModInt(-x, _mod); }

  friend ModInt operator+(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) += rhs;
  }

  friend ModInt operator-(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) -= rhs;
  }

  friend ModInt operator*(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) *= rhs;
  }

  ModInt pow(long long n) const {
    if (n == 0) {
      return ModInt(1, _mod);
    } else if (n % 2 == 1) {
      ModInt tmp = pow((n - 1) / 2);
      return tmp * tmp * ModInt(x, _mod);
    } else {
      ModInt tmp = pow(n / 2);
      return tmp * tmp;
    }
  }

  ModInt inv() const {
    assert(gcd(x, _mod) == 1);
    assert(_mod >= 2);
    return pow(_mod - 2);
  }

  ModInt &operator/=(const ModInt &rhs) {
    return (*this) = (*this) * rhs.inv();
  }

  friend ModInt operator/(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) /= rhs;
  }

  friend bool operator==(const ModInt &lhs, const ModInt &rhs) {
    return lhs.x == rhs.x;
  }

  friend bool operator!=(const ModInt &lhs, const ModInt &rhs) {
    return lhs.x != rhs.x;
  }
};

class ModIntGen {
  int modn;

public:
  ModIntGen() {}
  ModIntGen(int n) {
    assert(0 < n && n < INT_MAX);
    modn = n;
  }

  ModInt g(long long x) { return ModInt(x, modn); }
};

int main() {

  int s;
  cin >> s;

  ModIntGen mg(MODN);

  vector<ModInt> fact(s + s);
  fact[0] = mg.g(1);

  for (int i = 1; i <= s + s; i++) {
    fact[i] = fact[i - 1] * mg.g(i);
  }

  ModInt ans = mg.g(0);

  for (int i = 1; i <= s; i++) {
    int rest = s - i * 3;
    if (rest < 0)
      continue;

    ans += fact[rest + i - 1] / fact[rest] / fact[i - 1];
  }

  cout << ans.val() << endl;

  return 0;
}

#include <bits/stdc++.h>

#define rep(X, N) for (ll X = 0LL; X < (N); X++)
#define ALL(V) (V).begin(), (V).end()
#define endl "\\n"

using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;

const double PI = 3.1415926535897932384626;
const ll MODN = 1000000007;
const ll MODN2 = 998244353;

long long gcd(long long a, long long b) {
  if (a < b)
    swap(a, b);
  assert(b != 0);
  if (a % b == 0)
    return b;
  return gcd(b, a % b);
}

class ModInt {
  int _mod;
  long long x;

public:
  ModInt() {}
  ModInt(long long _x, int m) {
    _mod = m;
    x = _x % m;
    if (x < 0)
      x += m;
  }

  int val() { return (int)x; }

  int mod() { return _mod; }

  ModInt &operator++() {
    x++;
    if (x == _mod)
      x = 0;
    return *this;
  }

  ModInt &operator--() {
    if (x == 0)
      x = _mod;
    x--;
    return *this;
  }

  ModInt &operator+=(const ModInt &rhs) {
    x += rhs.x;
    if (x >= _mod)
      x -= _mod;
    return *this;
  }

  ModInt &operator-=(const ModInt &rhs) {
    x -= rhs.x;
    if (x < 0)
      x += _mod;
    return *this;
  }

  ModInt &operator*=(const ModInt &rhs) {
    x *= rhs.x;
    if (x >= _mod)
      x = x % _mod;
    return *this;
  }

  ModInt operator+() const { return *this; }

  ModInt operator-() const { return ModInt(-x, _mod); }

  friend ModInt operator+(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) += rhs;
  }

  friend ModInt operator-(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) -= rhs;
  }

  friend ModInt operator*(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) *= rhs;
  }

  ModInt pow(long long n) const {
    if (n == 0) {
      return ModInt(1, _mod);
    } else if (n % 2 == 1) {
      ModInt tmp = pow((n - 1) / 2);
      return tmp * tmp * ModInt(x, _mod);
    } else {
      ModInt tmp = pow(n / 2);
      return tmp * tmp;
    }
  }

  ModInt inv() const {
    assert(gcd(x, _mod) == 1);
    assert(_mod >= 2);
    return pow(_mod - 2);
  }

  ModInt &operator/=(const ModInt &rhs) {
    return (*this) = (*this) * rhs.inv();
  }

  friend ModInt operator/(const ModInt &lhs, const ModInt &rhs) {
    return ModInt(lhs) /= rhs;
  }

  friend bool operator==(const ModInt &lhs, const ModInt &rhs) {
    return lhs.x == rhs.x;
  }

  friend bool operator!=(const ModInt &lhs, const ModInt &rhs) {
    return lhs.x != rhs.x;
  }
};

class ModIntGen {
  int modn;

public:
  ModIntGen() {}
  ModIntGen(int n) {
    assert(0 < n && n < INT_MAX);
    modn = n;
  }

  ModInt g(long long x) { return ModInt(x, modn); }
};

int main() {

  int s;
  cin >> s;

  ModIntGen mg(MODN);

  vector<ModInt> fact(s + s + 1);
  fact[0] = mg.g(1);

  for (int i = 1; i <= s + s; i++) {
    fact[i] = fact[i - 1] * mg.g(i);
  }

  ModInt ans = mg.g(0);

  for (int i = 1; i <= s; i++) {
    int rest = s - i * 3;
    if (rest < 0)
      continue;

    ans += fact[rest + i - 1] / fact[rest] / fact[i - 1];
  }

  cout << ans.val() << endl;

  return 0;
}


#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <time.h>
#include <vector>
#define lli long long int
#define h 1000000007
#define s 10000
#define pf push_front
#define pb push_back
#define ub upper_bound
#define lb lowepr_bound
#define mp make_pair
#define pi 3.14159
using namespace std;
lli n, cnt = 0, flag = 0;
vector<lli> a;
void solve(lli sum) {
  lli i;
  if (sum == n) {
    cnt = ((cnt % h) + 1) % h;
    flag = 1;
    return;
  } else if (sum > n) {
    flag = 1;
    return;
  }
  for (i = 0; i < a.size(); i++) {
    solve(sum + a[i]);
    if (flag) {
      flag = 0;
      return;
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  lli i, sum = 0;
  cin >> n;
  for (i = 0; i < (n - 2); i++)
    a.pb(i + 3);
  solve(sum);
  cout << cnt << endl;
  return 0;
}

#include <algorithm>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <time.h>
#include <vector>
#define lli long long int
#define h 1000000007
#define s 2010
#define pf push_front
#define pb push_back
#define ub upper_bound
#define lb lowepr_bound
#define mp make_pair
#define pi 3.14159
using namespace std;
vector<lli> a(s, -1);
lli solve(lli sum) {
  lli i, cnt;
  if (sum == 0)
    return 1;
  else if (sum >= 3 && sum <= 5)
    return 1;
  else if (a[sum] != -1)
    return a[sum];
  else {
    cnt = 0;
    for (i = 3; i <= sum; i++) {
      if ((sum - i) >= 0)
        cnt = ((cnt % h) + (solve(sum - i) % h)) % h;
      else
        break;
    }
    a[sum] = cnt;
    return a[sum];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  lli i, n;
  cin >> n;
  cout << solve(n) << endl;
  return 0;
}


#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI = 3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for (int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y)-1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

vs64 f(2010), finv(2010);

s64 pow_mod(s64 x, s64 n, s64 mod) {
  s64 ret = 1;
  while (n) {
    if (n & 1)
      ret = ret * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return ret;
}

s64 init(int n) {
  assert(n <= 2000);
  f[0] = 1;
  rep(i, n) { f[i + 1] = f[i] * (i + 1) % MOD; }
  finv[n] = pow_mod(f[n], MOD - 2, MOD);
  for (int i = n - 1; i >= 0; --i) {
    finv[i] = finv[i + 1] * (i + 1) % MOD;
  }
}

s64 comb(int n, int k) {
  if (n < k || n < 0 || k < 0)
    return 0;
  return f[n] * finv[n - k] % MOD * finv[k] % MOD;
}

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

  int s;
  cin >> s;

  init(s);

  s64 ans = 0;
  for (int l = 1; l <= s / 3; ++l) {
    ans += comb(s - 2 * l - 1, s - 3 * l);
    ans %= MOD;
  }

  cout << ans << "\\n";
  return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI = 3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for (int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y)-1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

vs64 f(2010), finv(2010);

s64 pow_mod(s64 x, s64 n, s64 mod) {
  s64 ret = 1;
  while (n) {
    if (n & 1)
      ret = ret * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return ret;
}

void init(int n) {
  f[0] = 1;
  rep(i, n) { f[i + 1] = f[i] * (i + 1) % MOD; }
  finv[n] = pow_mod(f[n], MOD - 2, MOD);
  for (int i = n - 1; i >= 0; --i) {
    finv[i] = finv[i + 1] * (i + 1) % MOD;
  }
}

s64 comb(int n, int k) {
  if (n < k || n < 0 || k < 0)
    return 0;
  return f[n] * finv[n - k] % MOD * finv[k] % MOD;
}

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

  int s;
  cin >> s;

  init(s);

  s64 ans = 0;
  for (int l = 1; l <= s / 3; ++l) {
    ans += comb(s - 2 * l - 1, s - 3 * l);
    ans %= MOD;
  }

  cout << ans << "\\n";
  return 0;
}


/*** Template Begin ***/

#pragma region template

// #define USING_BOOST
#define USING_NAMESPACE

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

typedef int64_t i64;
typedef uint64_t u64;

auto init_ = [] {
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed;
  return 0;
}();

template <typename T> inline void in(T &x) { std::cin >> x; }

template <typename T, typename... Ts> inline void in(T &t, Ts &...ts) {
  std::cin >> t;
  in(ts...);
}

template <typename T, typename U = std::vector<T>> inline U vin(int n) {
  U v(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> v[i];
  }
  return v;
}

template <typename T, typename U = std::vector<T>, typename V = std::vector<U>>
inline V vin(int h, int w) {
  V vv(h, U(w));
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      std::cin >> vv[i][j];
    }
  }
  return vv;
}

template <typename T> inline void out(const T &x) {
  std::cout << x << std::endl;
}

template <char delimiter = ' ', typename T, typename... Ts>
inline void out(const T &t, const Ts &...ts) {
  std::cout << t << delimiter;
  out(ts...);
}

template <char delimiter = ' ', typename T>
inline void vout(const T &v, int n) {
  for (int i = 0; i < n; ++i) {
    if (i)
      std::cout << delimiter;
    std::cout << v[i];
  }
  std::cout << std::endl;
}

template <char delimiter = ' ', typename T>
inline void vout(const T &v, int h, int w) {
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (j)
        std::cout << delimiter;
      std::cout << v[i][j];
    }
    std::cout << std::endl;
  }
}

template <typename T, size_t D> struct multi_vector_type {
  using type = std::vector<typename multi_vector_type<T, D - 1>::type>;
};

template <typename T> struct multi_vector_type<T, 1> {
  using type = std::vector<T>;
};

template <typename T> struct multi_vector_type<T, 0> {
  using type = T;
};

template <typename T, size_t D>
using multi_vector = typename multi_vector_type<T, D>::type;

template <typename T, size_t D, class = typename std::enable_if<D == 0>::type>
T make_vector(const T &val = T()) {
  return val;
}

template <typename T, size_t D = 1, typename... Ts,
          class = typename std::enable_if<D != 0>::type>
multi_vector<T, D> make_vector(size_t n, Ts &&...args) {
  return multi_vector<T, D>(n, make_vector<T, D - 1>(args...));
}

namespace detail {

template <typename F> struct Debug {
  const char *delim_ = "\\n";
  F fun;

  Debug(F f) : fun(f) {}

  ~Debug() { fun(delim_); }

  Debug &delim(const char *d) {
    delim_ = d;
    return *this;
  }
};

std::deque<std::string> split(const std::string &s, char c) {
  std::deque<std::string> v;
  std::stringstream ss(s);
  std::string x;
  while (std::getline(ss, x, c))
    v.emplace_back(x);
  return v;
}

template <typename T>
void deb(const char *delim, std::deque<std::string> v, T a) {
  std::cerr << v[0].substr(v[0][0] == ' ', v[0].length()) << " = " << a << '\\n';
  std::cerr << std::flush;
}

template <typename T, typename... Args>
void deb(const char *delim, std::deque<std::string> v, T a, Args... args) {
  std::cerr << v[0].substr(v[0][0] == ' ', v[0].length()) << " = " << a
            << delim;
  v.pop_front();
  deb(delim, std::move(v), args...);
}

template <typename... Args> auto wrap(std::deque<std::string> v, Args... args) {
  auto f = [=](const char *delim = "\\n") { deb(delim, v, args...); };

  return Debug<decltype(f)>(f);
}
} // namespace detail

#define debug(args...) ::detail::wrap(::detail::split(#args, ','), args)

#ifdef USING_BOOST

#include <boost/math/common_factor.hpp>
#include <boost/range.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/algorithm_ext.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/numeric.hpp>

inline auto rep(int begin, int end) {
  if (begin > end) {
    return boost::irange(0, 0);
  } else {
    return boost::irange(begin, end);
  }
}

inline auto rep(int begin, int end, int step) {
  if ((step > 0 && begin > end) || (step < 0 && begin < end)) {
    return boost::irange(0, 0, step);
  } else {
    return boost::irange(begin, end, step);
  }
}

#endif

#ifdef USING_NAMESPACE
using namespace std;

#ifdef USING_BOOST
using namespace boost;
using namespace boost::adaptors;
#endif
#endif

#pragma endregion

/*** Template End ***/

int main() {
  i64 s;
  in(s);

  const i64 mod = 1000000007;

  vector<i64> dp(s + 1);

  dp[3] = 1;

  for (int i = 4; i <= s; i++) {
    i64 cnt = 1; // {i}

    for (int j = 3; j + 3 <= i; j++) {
      // {...}, {i - j}
      i64 add = dp[j];

      cnt = (cnt + add) % mod;
    }

    dp[i] = cnt;
  }

  out(dp[s]);
}

/*** Template Begin ***/

#pragma region template

// #define USING_BOOST
#define USING_NAMESPACE

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

typedef int64_t i64;
typedef uint64_t u64;

auto init_ = [] {
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed;
  return 0;
}();

template <typename T> inline void in(T &x) { std::cin >> x; }

template <typename T, typename... Ts> inline void in(T &t, Ts &...ts) {
  std::cin >> t;
  in(ts...);
}

template <typename T, typename U = std::vector<T>> inline U vin(int n) {
  U v(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> v[i];
  }
  return v;
}

template <typename T, typename U = std::vector<T>, typename V = std::vector<U>>
inline V vin(int h, int w) {
  V vv(h, U(w));
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      std::cin >> vv[i][j];
    }
  }
  return vv;
}

template <typename T> inline void out(const T &x) {
  std::cout << x << std::endl;
}

template <char delimiter = ' ', typename T, typename... Ts>
inline void out(const T &t, const Ts &...ts) {
  std::cout << t << delimiter;
  out(ts...);
}

template <char delimiter = ' ', typename T>
inline void vout(const T &v, int n) {
  for (int i = 0; i < n; ++i) {
    if (i)
      std::cout << delimiter;
    std::cout << v[i];
  }
  std::cout << std::endl;
}

template <char delimiter = ' ', typename T>
inline void vout(const T &v, int h, int w) {
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      if (j)
        std::cout << delimiter;
      std::cout << v[i][j];
    }
    std::cout << std::endl;
  }
}

template <typename T, size_t D> struct multi_vector_type {
  using type = std::vector<typename multi_vector_type<T, D - 1>::type>;
};

template <typename T> struct multi_vector_type<T, 1> {
  using type = std::vector<T>;
};

template <typename T> struct multi_vector_type<T, 0> {
  using type = T;
};

template <typename T, size_t D>
using multi_vector = typename multi_vector_type<T, D>::type;

template <typename T, size_t D, class = typename std::enable_if<D == 0>::type>
T make_vector(const T &val = T()) {
  return val;
}

template <typename T, size_t D = 1, typename... Ts,
          class = typename std::enable_if<D != 0>::type>
multi_vector<T, D> make_vector(size_t n, Ts &&...args) {
  return multi_vector<T, D>(n, make_vector<T, D - 1>(args...));
}

namespace detail {

template <typename F> struct Debug {
  const char *delim_ = "\\n";
  F fun;

  Debug(F f) : fun(f) {}

  ~Debug() { fun(delim_); }

  Debug &delim(const char *d) {
    delim_ = d;
    return *this;
  }
};

std::deque<std::string> split(const std::string &s, char c) {
  std::deque<std::string> v;
  std::stringstream ss(s);
  std::string x;
  while (std::getline(ss, x, c))
    v.emplace_back(x);
  return v;
}

template <typename T>
void deb(const char *delim, std::deque<std::string> v, T a) {
  std::cerr << v[0].substr(v[0][0] == ' ', v[0].length()) << " = " << a << '\\n';
  std::cerr << std::flush;
}

template <typename T, typename... Args>
void deb(const char *delim, std::deque<std::string> v, T a, Args... args) {
  std::cerr << v[0].substr(v[0][0] == ' ', v[0].length()) << " = " << a
            << delim;
  v.pop_front();
  deb(delim, std::move(v), args...);
}

template <typename... Args> auto wrap(std::deque<std::string> v, Args... args) {
  auto f = [=](const char *delim = "\\n") { deb(delim, v, args...); };

  return Debug<decltype(f)>(f);
}
} // namespace detail

#define debug(args...) ::detail::wrap(::detail::split(#args, ','), args)

#ifdef USING_BOOST

#include <boost/math/common_factor.hpp>
#include <boost/range.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/algorithm_ext.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/numeric.hpp>

inline auto rep(int begin, int end) {
  if (begin > end) {
    return boost::irange(0, 0);
  } else {
    return boost::irange(begin, end);
  }
}

inline auto rep(int begin, int end, int step) {
  if ((step > 0 && begin > end) || (step < 0 && begin < end)) {
    return boost::irange(0, 0, step);
  } else {
    return boost::irange(begin, end, step);
  }
}

#endif

#ifdef USING_NAMESPACE
using namespace std;

#ifdef USING_BOOST
using namespace boost;
using namespace boost::adaptors;
#endif
#endif

#pragma endregion

/*** Template End ***/

int main() {
  i64 s;
  in(s);

  if (s < 3) {
    out(0);
    return 0;
  }

  const i64 mod = 1000000007;

  vector<i64> dp(s + 1);

  dp[3] = 1;

  for (int i = 4; i <= s; i++) {
    i64 cnt = 1; // {i}

    for (int j = 3; j + 3 <= i; j++) {
      // {...}, {i - j}
      i64 add = dp[j];

      cnt = (cnt + add) % mod;
    }

    dp[i] = cnt;
  }

  out(dp[s]);
}


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

const int mod = 1e9 + 7;
long long int dp[2005];

int main() {
  int s;
  scanf("%d", &s);
  dp[0] = 1;
  dp[1] = dp[2] = 0;
  for (int a = 0; a <= s; a++) {
    for (int b = 3; b <= s; b++) {
      (dp[a + b] += dp[a]) %= mod;
    }
  }
  printf("%lld ", dp[s]);
}

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

const int mod = 1e9 + 7;
long long int dp[2005];

int main() {
  int s;
  scanf("%d", &s);
  dp[0] = 1;
  dp[1] = dp[2] = 0;
  for (int a = 0; a <= s; a++) {
    for (int b = 3; b <= s; b++) {
      if (a + b <= s)
        (dp[a + b] += dp[a]) %= mod;
    }
  }
  printf("%lld ", dp[s]);
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int inf = 1000000000;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const ll mod = 1e9 + 7;

ll solve(ll a) {
  if (a == 0) {
    return 1;
  } else if (a == 1 || a == 2) {
    return 0;
  } else if (a >= 3 && a <= 5) {
    return 1;
  } else {
    ll b = 0;
    for (ll i = a - 3; i >= 0; i--) {
      b = (b + solve(i)) % mod;
    }
    return b;
  }
}

int main() {
  ll s;
  cin >> s;
  vector<ll> ans(s + 1);
  rep(i, s + 1) { ans[i] = 0; }
  ans[0] = 1;
  ans[1] = 0;
  ans[2] = 0;
  ans[3] = 1;
  ans[4] = 1;
  ans[5] = 1;
  for (ll i = 6; i <= s; i++) {
    for (ll j = i - 3; j >= 0; j--) {
      ans[i] = (ans[i] + ans[j]) % mod;
    }
  }
  cout << ans[s] << endl;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int inf = 1000000000;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, 1, 0, -1};
const ll mod = 1e9 + 7;

ll solve(ll a) {
  if (a == 0) {
    return 1;
  } else if (a == 1 || a == 2) {
    return 0;
  } else if (a >= 3 && a <= 5) {
    return 1;
  } else {
    ll b = 0;
    for (ll i = a - 3; i >= 0; i--) {
      b = (b + solve(i)) % mod;
    }
    return b;
  }
}

int main() {
  ll s;
  cin >> s;
  vector<ll> ans(s + 10);
  rep(i, s + 10) { ans[i] = 0; }
  ans[0] = 1;
  ans[1] = 0;
  ans[2] = 0;
  ans[3] = 1;
  ans[4] = 1;
  ans[5] = 1;
  for (ll i = 6; i <= s; i++) {
    for (ll j = i - 3; j >= 0; j--) {
      ans[i] = (ans[i] + ans[j]) % mod;
    }
  }
  cout << ans[s] << endl;
}


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

#define REP(i, p, n) for (ll i = p; i < ll(n); ++i)
#define rep(i, n) REP(i, 0, n)

using ll = long long;
using pll = pair<ll, ll>;

const ll mod = 1000000007;

const ll MAXS = 2001;
ll dp[MAXS][MAXS];

ll S;

ll dfs(ll k, ll s) {
  if (S <= s) {
    return S == s ? 1 : 0;
  }
  if (dp[k][s] != -1) {
    return dp[k][s];
  }

  ll res = 0;

  for (ll ss = s + 3; ss <= S; ++ss) {
    res += dfs(k + 1, ss);
    res %= mod;
  }

  return dp[k][s] = res;
}

int main() {
  cin >> S;

  rep(i, S) {
    rep(j, S) { dp[i][j] = -1; }
  }

  const auto ans = dfs(0, 0);
  cout << ans << endl;

  return 0;
}

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

#define REP(i, p, n) for (ll i = p; i < ll(n); ++i)
#define rep(i, n) REP(i, 0, n)

using ll = long long;
using pll = pair<ll, ll>;

const ll mod = 1000000007;

const ll MAXS = 2001;
ll dp[MAXS];

int main() {
  ll S;
  cin >> S;

  dp[0] = 1;

  for (ll i = 3; i <= S; ++i) {
    dp[i] += (i - 1 >= 0 ? dp[i - 1] : 0);
    dp[i] += (i - 3 >= 0 ? dp[i - 3] : 0);
    dp[i] %= mod;
  }

  cout << dp[S] << endl;

  return 0;
}


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

#define ll long long
typedef pair<int, int> ii;
typedef pair<ll, int> lli;
#define ar array
#define pb push_back
#define fi first
#define se second
#define sz size
#define mp make_pair
#define nl '\\n'
#define all(x) (x).begin(), (x).end()
#define int_max numeric_limits<int>::max()
#define int_min numeric_limits<int>::min()
#define ll_max numeric_limits<ll>::max()
#define ll_min numeric_limits<ll>::min()

#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                 \\
  sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<(    \\
            c i) {
sim > struct rge {
  c b, e;
};
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
  ~debug() { cerr << endl; }
  eni(!=) cerr << boolalpha << i;
  ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair<b, c> d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
  sim dor(const c &) { ris; }
#endif
}
;
#define im(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// custom sort example
// sort(all(a), [ ]( const auto& c, const auto& d) {
// if (c.fi.se != d.fi.se) {
// return c.fi.se < d.fi.se; // lower first
//}
// if (c.fi.fi != d.fi.fi) {
// return c.fi.fi > d.fi.fi; // higher first
//}
// return c.se > d.se; // higher first
//});

struct chash {
  static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }

  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

template <class T> auto lbf(const std::set<std::pair<T, T>> &s, T first) {
  static constexpr T min = std::numeric_limits<T>::min();

  return s.lower_bound({first, min});
}

int MOD = 1000000007;

ll pw(ll n, ll k) {
  ll r = 1;
  for (; k; k >>= 1) {
    if (k & 1)
      r = r * n % MOD;
    n = n * n % MOD;
  }
  return r;
}
ll inv(ll n) { return pw(n, MOD - 2); }

// ll pom(ll a, ll b) {
// ll f = 1, t = 1;
// for (ll i = a; i > (a - b); i--) {
// f = (f * i) % MOD;
//}
// for (ll i = b; i > 0; i--) {
// t = (t * i) % MOD;
//}
// return ();
//}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
#endif
  ll n, res = 0;
  cin >> n;
  if (n < 3) {
    cout << 0 << nl;
  } else {
    ll act = n / 3;
    ll todo = n - (act * 3);
    while (act >= 1) {
      // res = (res + pom(todo, act)) % MOD;
      vector<vector<ll>> dp(act, vector<ll>(todo + 1));
      for (int i = 0; i < act; i++) {
        ll pom = 0;
        for (int j = 0; j <= todo; j++) {
          if (i == 0) {
            dp[i][j] = 1;
          } else {
            pom = (pom + dp[i - 1][j]) % MOD;
            dp[i][j] = pom;
            // for (int k = 0; k <= j; k++) {
            // dp[i][j] = (dp[i][j] + dp[i - 1][k]) % MOD;
            //}
          }
        }
      }
      // debug() << im(act) im(todo) im(dp);
      res = (res + dp[act - 1][todo]) % MOD;
      act--;
      todo = n - (act * 3);
    }
    cout << res << nl;
  }
}

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

#define ll long long
typedef pair<int, int> ii;
typedef pair<ll, int> lli;
#define ar array
#define pb push_back
#define fi first
#define se second
#define sz size
#define mp make_pair
#define nl '\\n'
#define all(x) (x).begin(), (x).end()
#define int_max numeric_limits<int>::max()
#define int_min numeric_limits<int>::min()
#define ll_max numeric_limits<ll>::max()
#define ll_min numeric_limits<ll>::min()

#define sim template <class c
#define ris return *this
#define dor > debug &operator<<
#define eni(x)                                                                 \\
  sim > typename enable_if<sizeof dud<c>(0) x 1, debug &>::type operator<<(    \\
            c i) {
sim > struct rge {
  c b, e;
};
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c *x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
  ~debug() { cerr << endl; }
  eni(!=) cerr << boolalpha << i;
  ris;
} eni(==) ris << range(begin(i), end(i));
}
sim, class b dor(pair<b, c> d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
  sim dor(const c &) { ris; }
#endif
}
;
#define im(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// custom sort example
// sort(all(a), [ ]( const auto& c, const auto& d) {
// if (c.fi.se != d.fi.se) {
// return c.fi.se < d.fi.se; // lower first
//}
// if (c.fi.fi != d.fi.fi) {
// return c.fi.fi > d.fi.fi; // higher first
//}
// return c.se > d.se; // higher first
//});

struct chash {
  static uint64_t splitmix64(uint64_t x) {
    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }

  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

template <class T> auto lbf(const std::set<std::pair<T, T>> &s, T first) {
  static constexpr T min = std::numeric_limits<T>::min();

  return s.lower_bound({first, min});
}

int MOD = 1000000007;

ll pw(ll n, ll k) {
  ll r = 1;
  for (; k; k >>= 1) {
    if (k & 1)
      r = r * n % MOD;
    n = n * n % MOD;
  }
  return r;
}
ll inv(ll n) { return pw(n, MOD - 2); }

// ll pom(ll a, ll b) {
// ll f = 1, t = 1;
// for (ll i = a; i > (a - b); i--) {
// f = (f * i) % MOD;
//}
// for (ll i = b; i > 0; i--) {
// t = (t * i) % MOD;
//}
// return ();
//}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
#ifdef LOCAL
  freopen("input.txt", "r", stdin);
#endif
  ll n, res = 0;
  cin >> n;
  if (n < 3) {
    cout << 0 << nl;
  } else {
    ll act = n / 3;
    ll todo = n - (act * 3);
    vector<vector<ll>> dp(act, vector<ll>(n + 1));
    for (int i = 0; i < act; i++) {
      ll pom = 0;
      for (int j = 0; j <= todo; j++) {
        if (i == 0) {
          dp[i][j] = 1;
        } else {
          pom = (pom + dp[i - 1][j]) % MOD;
          dp[i][j] = pom;
          // for (int k = 0; k <= j; k++) {
          // dp[i][j] = (dp[i][j] + dp[i - 1][k]) % MOD;
          //}
        }
      }
    }
    // debug() << im(act) im(todo) im(dp);
    res = (res + dp[act - 1][todo]) % MOD;
    // debug() << im(res);
    act--;
    ll prev = todo;
    todo = n - (act * 3);
    while (act >= 1) {
      // res = (res + pom(todo, act)) % MOD;

      for (int i = 0; i < act; i++) {
        ll pom;
        if (i != 0) {
          pom = dp[i][prev];
        } else {
          pom = 0;
        }
        for (int j = prev + 1; j <= todo; j++) {
          if (i == 0) {
            dp[i][j] = 1;
          } else {
            pom = (pom + dp[i - 1][j]) % MOD;
            dp[i][j] = pom;
            // for (int k = 0; k <= j; k++) {
            // dp[i][j] = (dp[i][j] + dp[i - 1][k]) % MOD;
            //}
          }
        }
      }
      // debug() << im(act) im(todo) im(dp);
      res = (res + dp[act - 1][todo]) % MOD;
      // debug() << im(res);
      act--;
      prev = todo;
      todo = n - (act * 3);
    }
    cout << res << nl;
  }
}


#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
const int MOD = 1e9 + 7;
const int INF = 1e18;
void io(string s = "file") {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}

int dp[2001];
int S;

int f(int s) {
  if (s < 0)
    return 0;
  if (s == 0)
    return 1;
  int &ans = dp[s];
  ans = 0;
  for (int j = 3; j <= s; j++) {
    ans += f(s - j);
    ans %= MOD;
  }
  return ans;
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> S;
  memset(dp, -1, sizeof dp);
  cout << f(S);
}

#include <bits/stdc++.h>
using namespace std;
#define int int64_t
#define double long double
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vii vector<pii>
const int MOD = 1e9 + 7;
const int INF = 1e18;
void io(string s = "file") {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}

int dp[2001];

int f(int s) {
  if (s < 0 || s == 1 || s == 2)
    return 0;
  if (s == 0)
    return 1;
  int &ans = dp[s];
  if (ans != -1)
    return ans;
  ans = 0;
  for (int j = 3; j <= s; j++) {
    ans += f(s - j);
    ans %= MOD;
  }
  return ans;
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int S;
  cin >> S;
  memset(dp, -1, sizeof dp);
  cout << f(S);
}


#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
int main() {
  ll n;
  cin >> n;
  ll dp[n + 1];
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  for (ll i = 4; i <= n; i++) {
    dp[i] = 1;
    for (ll j = 3; j <= i - 3; j++) {
      dp[i] += dp[j];
      dp[i] %= MOD;
    }
  }
  cout << dp[n];
}

#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
using namespace std;
int main() {
  ll n;
  cin >> n;
  ll dp[2001];
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  for (ll i = 4; i <= n; i++) {
    dp[i] = 1;
    for (ll j = 3; j <= i - 3; j++) {
      dp[i] += dp[j];
      dp[i] %= MOD;
    }
  }
  cout << dp[n];
}


#include <bits/stdc++.h>
#include <iostream>
#include <string>
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\\n"
#define mp make_pair
#define sz(v) (int)(v.size())
#define len(s) (int)(s.length())
#define M (ll)(1e9 + 7)
#define all(v) v.begin(), v.end()
#define fr(a, b, c) for (ll i = a; i <= b; i += c)
#define inarr(arr, n)                                                          \\
  ;                                                                            \\
  for (ll i = 0; i < n; i++)                                                   \\
    cin >> arr[i];
#define outarr(arr, n)                                                         \\
  ;                                                                            \\
  for (ll i = 0; i < n; i++)                                                   \\
    cout << arr[i] << " ";
#define ios                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
const ll inf = 9e18;
const ld pi = 2 * acos(0.0);
using namespace std;
ll power(ll a, ll n) {
  if (n == 0) {
    return 1;
  }
  ll p = power(a, n / 2) % M;
  p = (p * p) % M;
  if (n % 2 == 1) {
    p = (p * a) % M;
  }
  return p;
}
ll gcd(ll a, ll b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}
const int N = 1e6;
vector<ll> sieve(N, 0);
void si() {
  sieve[1] = 1;
  for (int i = 2; i < N; i++) {
    if (sieve[i] == 0) {
      for (int j = i; j < N; j += i) {
        sieve[j] = i;
      }
    }
  }
}
int main() {
  ios;
  vector<ll> fact(4005, 0);
  fact[0] = 1;
  for (ll i = 1; i <= 4005; i++) {
    fact[i] = (fact[i - 1] * i) % M;
  }
  ll s;
  cin >> s;
  ll ans = 0;
  for (ll i = 1; i <= 666; i++) {
    ll z = 3 * i;
    ll n = s - z;
    if (n < 0) {
      break;
    }
    ll k = fact[n + i - 1];
    ll div1 = power(fact[i - 1], M - 2) % M;
    ll div2 = power(fact[n], M - 2) % M;
    ll add = (((k * div1) % M) * div2) % M;
    ans += add;
    ans = ans % M;
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\\n"
#define mp make_pair
#define sz(v) (int)(v.size())
#define len(s) (int)(s.length())
#define M (ll)(1e9 + 7)
#define all(v) v.begin(), v.end()
#define fr(a, b, c) for (ll i = a; i <= b; i += c)
#define inarr(arr, n)                                                          \\
  ;                                                                            \\
  for (ll i = 0; i < n; i++)                                                   \\
    cin >> arr[i];
#define outarr(arr, n)                                                         \\
  ;                                                                            \\
  for (ll i = 0; i < n; i++)                                                   \\
    cout << arr[i] << " ";
#define ios                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
const ll inf = 9e18;
const ld pi = 2 * acos(0.0);
using namespace std;
ll power(ll a, ll n) {
  if (n == 0) {
    return 1;
  }
  ll p = power(a, n / 2) % M;
  p = (p * p) % M;
  if (n % 2 == 1) {
    p = (p * a) % M;
  }
  return p;
}
ll gcd(ll a, ll b) {
  if (a == 0)
    return b;
  return gcd(b % a, a);
}
const int N = 1e6;
vector<ll> sieve(N, 0);
void si() {
  sieve[1] = 1;
  for (int i = 2; i < N; i++) {
    if (sieve[i] == 0) {
      for (int j = i; j < N; j += i) {
        sieve[j] = i;
      }
    }
  }
}
int main() {
  ios;
  vector<ll> fact(4005, 0);
  fact[0] = 1;
  for (ll i = 1; i <= 4000; i++) {
    fact[i] = (fact[i - 1] * i) % M;
  }
  ll s;
  cin >> s;
  ll ans = 0;
  for (ll i = 1; i <= 666; i++) {
    ll z = 3 * i;
    ll n = s - z;
    if (n < 0) {
      break;
    }
    ll k = fact[n + i - 1];
    ll div1 = power(fact[i - 1], M - 2) % M;
    ll div2 = power(fact[n], M - 2) % M;
    ll add = (((k * div1) % M) * div2) % M;
    ans += add;
    ans = ans % M;
  }
  cout << ans << endl;
  return 0;
}


#include <bits/stdc++.h>
#define ll int
int const MOD = 1e9 + 7;
#define fastIO                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)
using namespace std;
ll sum;
ll cache[700][2001];
ll dp(int i, int s) {
  if (s > sum)
    return 0;
  if (s == sum)
    return 1;
  ll &ans = cache[i][s];
  if (ans != -1)
    return ans;
  ans = 0;
  for (int j = 3; j <= sum; j++)
    ans += dp(i + 1, s + j), ans %= MOD;
  return ans % MOD;
}
int32_t main() {
  fastIO;
  memset(cache, -1, sizeof(cache));
  cin >> sum;
  ll ans = 0;
  for (int i = 3; i <= sum; i++)
    ans += dp(0, i), ans %= MOD;
  cout << ans;

  return 0;
}

#include <bits/stdc++.h>
#define ll int
int const MOD = 1e9 + 7;
#define fastIO                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL)
using namespace std;
ll sum;
ll cache[700][2001];
ll dp(int i, int s) {
  if (s > sum)
    return 0;
  if (s == sum)
    return 1;
  ll &ans = cache[i][s];
  if (ans != -1)
    return ans;
  ans = 0;
  for (int j = 3; j <= sum - s; j++)
    ans += dp(i + 1, s + j), ans %= MOD;
  return ans % MOD;
}
int32_t main() {
  fastIO;
  memset(cache, -1, sizeof(cache));
  cin >> sum;
  ll ans = 0;
  for (int i = 3; i <= sum; i++)
    ans += dp(0, i), ans %= MOD;
  cout << ans;

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
ll n;
ll d[701][2001];
ll mod = 1e9 + 7;

ll go(int x, int y) {
  if (y == n) {
    return 1;
  }
  ll &ret = d[x][y];
  if (ret != -1)
    return ret;
  ret = 0;
  for (int i = 3; i <= 2000; i++) {
    if (y + i <= n) {
      ret += go(x + 1, y + i);
      ret %= mod;
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  cin >> n;

  memset(d, -1, sizeof(d));

  cout << go(0, 0) << '\\n';
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
ll n;
ll d[2001];
ll mod = 1e9 + 7;

ll go(int x) {
  if (x == n) {
    return 1;
  }
  ll &ret = d[x];
  if (ret != -1)
    return ret;
  ret = 0;
  for (int i = 3; i <= 2000; i++) {
    if (x + i <= n) {
      ret += go(x + i);
      ret %= mod;
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);

  cin >> n;

  memset(d, -1, sizeof(d));

  cout << go(0) << '\\n';
}


#include <bits/stdc++.h>
#define mod 1000000007
using namespace std;
int a[10001] = {1}, n;
unsigned long long ans;
void print(int t) {
  for (int i = 1; i <= t; i++)
    if (a[i] < 3)
      return;
  ans++;
  ans %= mod;
}
int search(int s, int t) {
  int i;
  for (int i = 1; i <= s; i++)
    if (i < n) {
      a[t] = i;
      s -= i;
      if (s == 0)
        print(t);
      else
        search(s, t + 1);
      s += i;
    }
}
int main() {
  cin >> n;
  if (n < 3) {
    cout << "0";
    return 0;
  }

  search(n, 1);
  ans++;
  cout << ans % mod;
}

#include <bits/stdc++.h>
#define ios ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long int ll;
const ll mod = 1e9 + 7;
ll f[2006];
int main() {
  ios;
  f[0] = 1;
  for (int i = 3; i <= 2000; ++i)
    for (int j = 3; j <= i; ++j) {
      f[i] = (f[i] + f[i - j]) % mod;
    }
  int s;
  cin >> s;
  cout << f[s] << '\\n';
}


#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
const long long mod = 1e9 + 7;
long long dp[N] = {};
int main() {
  int n;
  cin >> n;
  fill(dp + 3, dp + n + 1, 1);
  for (int i = 4; i <= n; i++)
    for (int j = i - 3; j >= 0; j--)
      dp[i] = (dp[i] + dp[j]) % mod;
  cout << dp[n] << '\\n';
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
const int N = 5005;
const long long mod = 1e9 + 7;
long long dp[N] = {};
int main() {
  int n;
  cin >> n;
  if (n >= 3)
    fill(dp + 3, dp + n + 1, 1);
  for (int i = 4; i <= n; i++)
    for (int j = i - 3; j >= 0; j--)
      dp[i] = (dp[i] + dp[j]) % mod;
  cout << dp[n] << '\\n';
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define F(i, a, n) for (int i = a; i < n; i++)
#define mod 1000000007
#define pb push_back
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int w = 1;
  // cin>>w;
  while (w--) {
    long long n;
    cin >> n;
    vector<ll> v(n + 1, 0);
    v[0] = 1;
    v[3] = 1;
    v[4] = 1;
    v[5] = 1;
    F(i, 6, n + 1) {
      F(j, 3, i + 1) {
        if (i - j >= 0)
          v[i] = (v[i] % mod + v[i - j] % mod) % mod;
      }
    }
    cout << v[n];
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define F(i, a, n) for (int i = a; i < n; i++)
#define mod 1000000007
#define pb push_back
int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int w = 1;
  // cin>>w;
  while (w--) {
    long long n;
    cin >> n;
    vector<ll> v(2005, 0);
    v[0] = 1;
    v[3] = 1;
    v[4] = 1;
    v[5] = 1;
    F(i, 6, n + 1) {
      F(j, 3, i + 1) {
        if (i - j >= 0)
          v[i] = (v[i] % mod + v[i - j] % mod) % mod;
      }
    }
    cout << v[n];
  }
  return 0;
}

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc


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

const int mod = 1000000007;

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

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

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

const int mod = 1000000007;

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

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


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl "\\n"
#define IOS                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
ll n;
ll mod = 1000000007;
ll dp[1000][30000];
ll finds(ll in, ll sum) {
  if (sum > n)
    return 0;
  if (sum == n)
    return 1;
  if (dp[in][sum] != -1)
    return dp[in][sum];
  ll ans = 0;
  for (int i = 3; i <= (n - sum) + 1; i++) {
    if (sum + i <= n)
      ans += finds(in + 1, sum + i);
    if (ans != 0)
      ans %= mod;
  }
  return dp[in][sum] = ans;
}
int main() {
  // IOS;
  // ll t;cin>>t;while(t--)
  {
    memset(dp, -1, sizeof dp);
    ll a, b, c, d, i, j, k, l, m, temp = 0, f = 0, cnt = 0;
    cin >> n;
    cout << finds(0, 0) << endl;
  }
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl "\\n"
#define IOS                                                                    \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
ll n;
ll mod = 1000000007;
ll dp[30000];
ll finds(ll in, ll sum) {
  if (sum > n)
    return 0;
  if (sum == n)
    return 1;
  if (dp[sum] != -1)
    return dp[sum];
  ll ans = 0;
  for (int i = 3; i <= (n - sum); i++) {
    if (sum + i <= n)
      ans += finds(in + 1, sum + i);
    if (ans != 0)
      ans %= mod;
  }
  return dp[sum] = ans;
}
int main() {
  // IOS;
  // ll t;cin>>t;while(t--)
  {
    memset(dp, -1, sizeof dp);
    ll a, b, c, d, i, j, k, l, m, temp = 0, f = 0, cnt = 0;
    cin >> n;
    cout << finds(0, 0) << endl;
  }
}


//////https://atcoder.jp/contests/abc178/tasks/abc178_d
#include <bits/stdc++.h>
using namespace std;

const int MO = 1e9 + 7;
int s;
long long ans = 0;
vector<int> seq;

void dfs(int sum) {
  if (s == sum) {
    ans = (ans + 1) % MO;
#if 0
        cout<<"{";
        for (int i=0; i<seq.size(); i++) {
            cout<<seq[i]<<",";
        }
        cout<<"}\\n";
#endif
    return;
  } else if (sum > s) {
    return;
  }
  for (int i = 3; i <= s - sum; i++) {
    seq.push_back(i);
    dfs(sum + i);
    seq.pop_back();
  }
}

int main() {
  cin >> s;

  dfs(0);
  cout << ans << "\\n";

  return 0;
}

//////https://atcoder.jp/contests/abc178/tasks/abc178_d
#include <bits/stdc++.h>

using namespace std;

const int MO = 1e9 + 7;
const int MAXN = 2e3 + 2;
long long ans[MAXN];

int main() {
  int s;
  cin >> s;

  // 初始化ans
  ans[0] = 1;

  for (int i = 3; i <= s; i++) {
    for (int j = 3; j <= i; j++) {
      ans[i] = (ans[i] + ans[i - j]) % MO;
    }
  }

  cout << ans[s] << "\\n";

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i, a, b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i, a, b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i, n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define debug(x) cout << #x << ": " << x << endl
#define all(ar) ar.begin(), ar.end()
#define rall(ar) ar.rbegin(), ar.rend()
#define sz(x) ((long long)x.size())
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
#define mp make_pair
#define ff first
#define ss second
#define MOD 1000000007

auto clk = clock();
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll INF = 1e18L + 5;
const int d4i[4] = {-1, 0, 1, 0}, d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
          d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};

typedef pair<ll, ll> ii;
typedef pair<ll, ii> iii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<int> vint;
typedef vector<string> vs;
typedef vector<vi> vvi;

const int N_MAX = 2005;
ll dp[N_MAX][N_MAX];

ll combi(ll n, ll r) {
  if (r == 0 || r == n)
    return 1;
  if (dp[n][r] != -1)
    return dp[n][r];
  ll a = combi(n - 1, r - 1);
  ll b = combi(n - 1, r);
  dp[n][r] = (a + b) % MOD;
  return dp[n][r];
}

ll modexp(ll base, ll power) {
  if (base == 0)
    return 0ll;
  if (power == 0)
    return 1ll;
  ll res = 1;
  while (power) {
    if (power & 1)
      res = (res * base) % MOD;
    base = (base * base) % MOD;
    power /= 2;
  }
  return res;
}

void solve() {
  ll n;
  cin >> n;
  ll dp[n + 1];
  fr(i, 3, n) dp[i] = 1;
  dp[3] = 1;
  fr(i, 4, n) {
    for (ll j = 3; j <= i - 3; j++) {
      dp[i] = (dp[i] + dp[j]) % MOD;
    }
  }
  cout << dp[n];
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(11);
  memset(dp, -1, sizeof(dp));
  ll t = 1;
  // cin>>t;
  while (t--)
    solve();

  // cout<<endl<<endl<<"Time elapsed:
  // "<<((double)(clock()-clk)/CLOCKS_PER_SEC)*1000<<"ms"<<endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fr(i, a, b) for (ll i = (a), _b = (b); i <= _b; i++)
#define frr(i, a, b) for (ll i = (a), _b = (b); i >= _b; i--)
#define rep(i, n) for (ll i = 0, _n = (n); i < _n; i++)
#define repr(i, n) for (ll i = (n)-1; i >= 0; i--)
#define debug(x) cout << #x << ": " << x << endl
#define all(ar) ar.begin(), ar.end()
#define rall(ar) ar.rbegin(), ar.rend()
#define sz(x) ((long long)x.size())
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
#define mp make_pair
#define ff first
#define ss second
#define MOD 1000000007

auto clk = clock();
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ll INF = 1e18L + 5;
const int d4i[4] = {-1, 0, 1, 0}, d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
          d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};

typedef pair<ll, ll> ii;
typedef pair<ll, ii> iii;
typedef vector<ii> vii;
typedef vector<ll> vi;
typedef vector<int> vint;
typedef vector<string> vs;
typedef vector<vi> vvi;

const int N_MAX = 2005;
ll dp[N_MAX][N_MAX];

ll combi(ll n, ll r) {
  if (r == 0 || r == n)
    return 1;
  if (dp[n][r] != -1)
    return dp[n][r];
  ll a = combi(n - 1, r - 1);
  ll b = combi(n - 1, r);
  dp[n][r] = (a + b) % MOD;
  return dp[n][r];
}

ll modexp(ll base, ll power) {
  if (base == 0)
    return 0ll;
  if (power == 0)
    return 1ll;
  ll res = 1;
  while (power) {
    if (power & 1)
      res = (res * base) % MOD;
    base = (base * base) % MOD;
    power /= 2;
  }
  return res;
}

void solve() {
  ll n;
  cin >> n;
  ll dp[n + 1];
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = 0;
  fr(i, 3, n) dp[i] = 1;
  fr(i, 4, n) {
    for (ll j = 3; j <= i - 3; j++) {
      dp[i] = (dp[i] + dp[j]) % MOD;
    }
  }
  cout << dp[n];
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout << setprecision(11);
  memset(dp, -1, sizeof(dp));
  ll t = 1;
  // cin>>t;
  while (t--)
    solve();

  // cout<<endl<<endl<<"Time elapsed:
  // "<<((double)(clock()-clk)/CLOCKS_PER_SEC)*1000<<"ms"<<endl;
  return 0;
}


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

template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;

using ll = long long;
using ull = unsigned long long;
using vll = V<ll>;
using vvll = V<vll>;
using vvvll = V<vvll>;
using pl = P<ll, ll>;
using vpl = V<pl>;
using vvpl = V<vpl>;
using vs = V<string>;
using qll = queue<ll>;
using qpl = queue<pl>;
using mapll = map<ll, ll>;
using setll = set<ll>;
using pqll = priority_queue<ll>;

#define int ll
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
#define sz size()
#define bgn begin()
#define en end()
#define emp empty()
#define fr front()
#define bk back()
#define res resize
#define tp top()
#define p_q priority_queue
#define inv inverse()

#define FOR(i, a, b) for (ll i = (a); i <= (ll)(b); i++)
#define rFOR(i, a, b) for (ll i = (b); i >= (ll)(a); i--)
#define REP(i, a) FOR((i), 0, (ll)(a)-1)
#define REP0(i, a) FOR((i), 0, (ll)(a))
#define REP1(i, a) FOR((i), 1, (ll)(a))
#define rREP(i, a) rFOR((i), 0, (ll)(a)-1)
#define rREP0(i, a) rFOR((i), 0, (ll)(a))
#define rREP1(i, a) rFOR((i), 1, (ll)(a))
#define IOTA(a, n) iota((a).bgn, (a).en, (n))
#define SORT(a) sort((a).bgn, (a).en)
#define rSORT(a) sort((a).rbegin(), (a).rend())
#define UNIQUE(a) (a).erase(unique((a).bgn, (a).en), (a).en)
#define BINS(a, b) binary_search((a).bgn, (a).en, (b))
#define LOWB(a, b) (lower_bound((a).bgn, (a).en, (b)) - (a).bgn)
#define UPB(a, b) (upper_bound((a).bgn, (a).en, (b)) - (a).bgn)
#define CNT(a, b) count((a).bgn, (a).en, b)
#define SUM(a) accumulate((a).bgn, (a).en, 0)
#define REV(a) reverse((a).bgn, (a).en)
#define yn(a) cout << ((a) ? "yes" : "no") << "\\n";
#define Yn(a) cout << ((a) ? "Yes" : "No") << "\\n";
#define YN(a) cout << ((a) ? "YES" : "NO") << "\\n";
#define imp(a) cout << ((a) ? "possible" : "impossible") << "\\n";
#define Imp(a) cout << ((a) ? "Possible" : "Impossible") << "\\n";
#define IMP(a) cout << ((a) ? "POSSIBLE" : "IMPOSSIBLE") << "\\n";
#define dbg(a) cerr << (#a) << ": " << (a) << "\\n";
#define DigN2(a) ((llabs(a) == 0) ? (1) : ((ll)(log2(double(llabs(a)))) + 1))
#define DigN10(a) ((llabs(a) == 0) ? (1) : ((ll)(log10(double(llabs(a)))) + 1))
#define Dig2(a, b) (((a) >> (b)) & 1)
#define Dig10(a, b) (ll)(((a) / ((ll)(pow(10.0, (double)(b))))) % 10)
#define Pow2(a) ((ll)(1) << (a))
#define Pow10(a) ((ll)(pow(10.0, double(a))))
#define powll(a, b) (ll)(pow((double)(a), (double)(b)))

#define li(...)                                                                \\
  ll __VA_ARGS__;                                                              \\
  Input(__VA_ARGS__);
#define si(...)                                                                \\
  string __VA_ARGS__;                                                          \\
  Input(__VA_ARGS__);
#define vli(size, ...)                                                         \\
  vll __VA_ARGS__;                                                             \\
  vInput(size, __VA_ARGS__);
#define vsi(size, ...)                                                         \\
  vs __VA_ARGS__;                                                              \\
  vInput(size, __VA_ARGS__);

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
// const ll MOD = 924844033;
// const ll MOD = 9007199254740881;
const ll INF = 1LL << 60; // 1.15e18
const double PI = acos(-1.0);
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

void Input() {}
template <class Var, class... Args> void Input(Var &var, Args &...args) {
  cin >> var;
  Input(args...);
}

void vInit(ll size) {}
template <class T, class... Args> void vInit(ll size, V<T> &v, Args &...args) {
  v.res(size);
  vInit(size, args...);
}
void vInputNum(ll num) {}
template <class T, class... Args>
void vInputNum(ll num, V<T> &v, Args &...args) {
  cin >> v[num];
  vInputNum(num, args...);
}
void vInput(ll size) {}
template <class... Args> void vInput(ll size, Args &...args) {
  vInit(size, args...);
  REP(i, size) vInputNum(i, args...);
}

template <class S, class T>
ostream &operator<<(ostream &out, const P<S, T> &p) {
  return out << "[" << p.fi << ", " << p.se << "]";
}

template <class T> ostream &operator<<(ostream &out, V<T> &v) {
  if (v.emp)
    return out << "{}";
  else {
    auto itr = v.bgn;
    out << "{" << *itr;
    itr++;
    while (itr != v.en) {
      out << ", " << *itr;
      itr++;
    }
    out << "}";
    return out;
  }
}

template <class S, class T>
ostream &operator<<(ostream &out, const map<S, T> &m) {
  if (m.emp)
    return out << "<[]>";
  else {
    auto itr = m.bgn;
    out << "< [" << (itr->fi) << ": " << (itr->se);
    itr++;
    while (itr != m.en) {
      out << "], [" << (itr->fi) << ": " << (itr->se);
      itr++;
    }
    out << "] >";
    return out;
  }
}

template <class T> ostream &operator<<(ostream &out, const set<T> &s) {
  if (s.emp)
    return out << "<>";
  else {
    auto itr = s.bgn;
    out << "<" << *itr;
    itr++;
    while (itr != s.en) {
      out << ", " << *itr;
      itr++;
    }
    out << ">";
    return out;
  }
}

ll gcd(ll a, ll b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }
  return b ? gcd(b, a % b) : a;
}

// a > b
ll gcdex(ll a, ll b) { return b ? gcdex(b, a % b) : a; }

ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

struct UFT {

public:
  ll tsize;
  ll mode;
  vll par;
  vll rank;
  UFT() {}
  UFT(const UFT &uft) {}
  UFT(ll tsizeget, ll modeget = 0) {
    tsize = tsizeget;
    mode = modeget;
    par.assign(tsize, -1);
    if (!mode)
      rank.res(tsize, 0);
  }
  ll root(ll x) { return par[x] < 0 ? x : par[x] = root(par[x]); }
  bool isRoot(ll x) { return x == root(x); }
  bool same(ll x, ll y) { return root(x) == root(y); }
  void merge(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x == y)
      return;
    if (mode) {
      par[x] += par[y];
      par[y] = x;
    } else {
      if (rank[x] < rank[y]) {
        par[y] += par[x];
        par[x] = y;
      } else {
        par[x] += par[y];
        par[y] = x;
        if (rank[x] == rank[y])
          rank[x]++;
      }
    }
  }
  ll size(ll x) { return -par[root(x)]; }
};

ll isP(ll n) {
  if (n <= 1)
    return 0;
  FOR(i, 2, (ll)sqrt(n) + 1) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}

vvll CombMemo(3000, vll(3000, -1));

ll Comb(ll n, ll k) {
  if ((n < 0) || (k < 0))
    return 0;
  if (CombMemo[n][k] == -1) {
    if (n < k)
      CombMemo[n][k] = 0;
    else {
      if (n == 0)
        CombMemo[n][k] = 1;
      else if (k == 0)
        CombMemo[n][k] = 1;
      else if (n == k)
        CombMemo[n][k] = 1;
      else
        CombMemo[n][k] = Comb(n - 1, k - 1) + Comb(n - 1, k);
    }
  }
  return CombMemo[n][k];
}

void Solve();

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  Solve();
}

void Solve() {
  li(n);

  vvll dp(700, vll(2001, 0));

  REP(j, 2001) { dp[1][j] = 1; }

  FOR(i, 2, 667) {
    FOR(j, 3, 2000) {
      FOR(k, 3, j - 3) {
        dp[i][j] += dp[i - 1][k];
        dp[i][j] %= MOD;
      }
    }
  }

  ll r = 0;

  REP(i, 700) {
    r += dp[i][n];
    r %= MOD;
  }

  cout << r;
}

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

template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;

using ll = long long;
using ull = unsigned long long;
using vll = V<ll>;
using vvll = V<vll>;
using vvvll = V<vvll>;
using pl = P<ll, ll>;
using vpl = V<pl>;
using vvpl = V<vpl>;
using vs = V<string>;
using qll = queue<ll>;
using qpl = queue<pl>;
using mapll = map<ll, ll>;
using setll = set<ll>;
using pqll = priority_queue<ll>;

#define int ll
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pob pop_back()
#define pf push_front
#define pof pop_front()
#define sz size()
#define bgn begin()
#define en end()
#define emp empty()
#define fr front()
#define bk back()
#define res resize
#define tp top()
#define p_q priority_queue
#define inv inverse()

#define FOR(i, a, b) for (ll i = (a); i <= (ll)(b); i++)
#define rFOR(i, a, b) for (ll i = (b); i >= (ll)(a); i--)
#define REP(i, a) FOR((i), 0, (ll)(a)-1)
#define REP0(i, a) FOR((i), 0, (ll)(a))
#define REP1(i, a) FOR((i), 1, (ll)(a))
#define rREP(i, a) rFOR((i), 0, (ll)(a)-1)
#define rREP0(i, a) rFOR((i), 0, (ll)(a))
#define rREP1(i, a) rFOR((i), 1, (ll)(a))
#define IOTA(a, n) iota((a).bgn, (a).en, (n))
#define SORT(a) sort((a).bgn, (a).en)
#define rSORT(a) sort((a).rbegin(), (a).rend())
#define UNIQUE(a) (a).erase(unique((a).bgn, (a).en), (a).en)
#define BINS(a, b) binary_search((a).bgn, (a).en, (b))
#define LOWB(a, b) (lower_bound((a).bgn, (a).en, (b)) - (a).bgn)
#define UPB(a, b) (upper_bound((a).bgn, (a).en, (b)) - (a).bgn)
#define CNT(a, b) count((a).bgn, (a).en, b)
#define SUM(a) accumulate((a).bgn, (a).en, 0)
#define REV(a) reverse((a).bgn, (a).en)
#define yn(a) cout << ((a) ? "yes" : "no") << "\\n";
#define Yn(a) cout << ((a) ? "Yes" : "No") << "\\n";
#define YN(a) cout << ((a) ? "YES" : "NO") << "\\n";
#define imp(a) cout << ((a) ? "possible" : "impossible") << "\\n";
#define Imp(a) cout << ((a) ? "Possible" : "Impossible") << "\\n";
#define IMP(a) cout << ((a) ? "POSSIBLE" : "IMPOSSIBLE") << "\\n";
#define dbg(a) cerr << (#a) << ": " << (a) << "\\n";
#define DigN2(a) ((llabs(a) == 0) ? (1) : ((ll)(log2(double(llabs(a)))) + 1))
#define DigN10(a) ((llabs(a) == 0) ? (1) : ((ll)(log10(double(llabs(a)))) + 1))
#define Dig2(a, b) (((a) >> (b)) & 1)
#define Dig10(a, b) (ll)(((a) / ((ll)(pow(10.0, (double)(b))))) % 10)
#define Pow2(a) ((ll)(1) << (a))
#define Pow10(a) ((ll)(pow(10.0, double(a))))
#define powll(a, b) (ll)(pow((double)(a), (double)(b)))

#define li(...)                                                                \\
  ll __VA_ARGS__;                                                              \\
  Input(__VA_ARGS__);
#define si(...)                                                                \\
  string __VA_ARGS__;                                                          \\
  Input(__VA_ARGS__);
#define vli(size, ...)                                                         \\
  vll __VA_ARGS__;                                                             \\
  vInput(size, __VA_ARGS__);
#define vsi(size, ...)                                                         \\
  vs __VA_ARGS__;                                                              \\
  vInput(size, __VA_ARGS__);

const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
// const ll MOD = 924844033;
// const ll MOD = 9007199254740881;
const ll INF = 1LL << 60; // 1.15e18
const double PI = acos(-1.0);
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

void Input() {}
template <class Var, class... Args> void Input(Var &var, Args &...args) {
  cin >> var;
  Input(args...);
}

void vInit(ll size) {}
template <class T, class... Args> void vInit(ll size, V<T> &v, Args &...args) {
  v.res(size);
  vInit(size, args...);
}
void vInputNum(ll num) {}
template <class T, class... Args>
void vInputNum(ll num, V<T> &v, Args &...args) {
  cin >> v[num];
  vInputNum(num, args...);
}
void vInput(ll size) {}
template <class... Args> void vInput(ll size, Args &...args) {
  vInit(size, args...);
  REP(i, size) vInputNum(i, args...);
}

template <class S, class T>
ostream &operator<<(ostream &out, const P<S, T> &p) {
  return out << "[" << p.fi << ", " << p.se << "]";
}

template <class T> ostream &operator<<(ostream &out, V<T> &v) {
  if (v.emp)
    return out << "{}";
  else {
    auto itr = v.bgn;
    out << "{" << *itr;
    itr++;
    while (itr != v.en) {
      out << ", " << *itr;
      itr++;
    }
    out << "}";
    return out;
  }
}

template <class S, class T>
ostream &operator<<(ostream &out, const map<S, T> &m) {
  if (m.emp)
    return out << "<[]>";
  else {
    auto itr = m.bgn;
    out << "< [" << (itr->fi) << ": " << (itr->se);
    itr++;
    while (itr != m.en) {
      out << "], [" << (itr->fi) << ": " << (itr->se);
      itr++;
    }
    out << "] >";
    return out;
  }
}

template <class T> ostream &operator<<(ostream &out, const set<T> &s) {
  if (s.emp)
    return out << "<>";
  else {
    auto itr = s.bgn;
    out << "<" << *itr;
    itr++;
    while (itr != s.en) {
      out << ", " << *itr;
      itr++;
    }
    out << ">";
    return out;
  }
}

ll gcd(ll a, ll b) {
  if (a < b) {
    a ^= b;
    b ^= a;
    a ^= b;
  }
  return b ? gcd(b, a % b) : a;
}

// a > b
ll gcdex(ll a, ll b) { return b ? gcdex(b, a % b) : a; }

ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

struct UFT {

public:
  ll tsize;
  ll mode;
  vll par;
  vll rank;
  UFT() {}
  UFT(const UFT &uft) {}
  UFT(ll tsizeget, ll modeget = 0) {
    tsize = tsizeget;
    mode = modeget;
    par.assign(tsize, -1);
    if (!mode)
      rank.res(tsize, 0);
  }
  ll root(ll x) { return par[x] < 0 ? x : par[x] = root(par[x]); }
  bool isRoot(ll x) { return x == root(x); }
  bool same(ll x, ll y) { return root(x) == root(y); }
  void merge(ll x, ll y) {
    x = root(x);
    y = root(y);
    if (x == y)
      return;
    if (mode) {
      par[x] += par[y];
      par[y] = x;
    } else {
      if (rank[x] < rank[y]) {
        par[y] += par[x];
        par[x] = y;
      } else {
        par[x] += par[y];
        par[y] = x;
        if (rank[x] == rank[y])
          rank[x]++;
      }
    }
  }
  ll size(ll x) { return -par[root(x)]; }
};

ll isP(ll n) {
  if (n <= 1)
    return 0;
  FOR(i, 2, (ll)sqrt(n) + 1) {
    if (n % i == 0)
      return 0;
  }
  return 1;
}

vvll CombMemo(3000, vll(3000, -1));

ll Comb(ll n, ll k) {
  if ((n < 0) || (k < 0))
    return 0;
  if (CombMemo[n][k] == -1) {
    if (n < k)
      CombMemo[n][k] = 0;
    else {
      if (n == 0)
        CombMemo[n][k] = 1;
      else if (k == 0)
        CombMemo[n][k] = 1;
      else if (n == k)
        CombMemo[n][k] = 1;
      else
        CombMemo[n][k] = (Comb(n - 1, k - 1) + Comb(n - 1, k)) % MOD;
    }
  }
  return CombMemo[n][k];
}

void Solve();

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(20) << fixed;
  Solve();
}

void Solve() {
  li(n);

  ll r = 0;

  FOR(i, 0, n - 3 - i * 2) {
    r += (Comb(n - 3 - i * 2, i) % MOD);
    // cout << Comb(n-3-i*2,i) << endl;
    r %= MOD;
  }

  cout << r;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 999999999
#define rep(i, n) for (int i = 0; i < n; i++)
const ll MOD = 1000000007;
ll cnt = 0, ans = 0;
const int MAX = 510000;

ll move(ll n) {
  ll a[n + 1];
  a[0] = 1;
  a[1] = 0;
  a[2] = 0;
  a[3] = 1;

  for (int i = 4; i <= n; i++) {
    a[i] = (a[i - 1] + a[i - 3]) % MOD;
  }
  return a[n];
}

int main() {
  ll n;
  cin >> n;
  ans = move(n);
  cout << ans % MOD << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 999999999
#define rep(i, n) for (int i = 0; i < n; i++)
const ll MOD = 1000000007;
ll cnt = 0, ans = 0;
const int MAX = 510000;

ll move(ll n) {
  ll a[n + 10];
  a[0] = 1;
  a[1] = 0;
  a[2] = 0;
  a[3] = 1;

  for (int i = 4; i <= n; i++) {
    a[i] = (a[i - 1] + a[i - 3]) % MOD;
  }
  return a[n];
}

int main() {
  ll n;
  cin >> n;
  ans = move(n);
  cout << ans % MOD << endl;
}


#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()

using ll = long long;
using ld = long double;
using namespace std;

const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ll N = 2e3 + 5;

int s, fact[N];

ll fastpow(ll a, ll n, ll m) {
  ll res = 1;
  while (n) {
    if (n & 1)
      res = (res * a) % m;
    n >>= 1;
    a = (a * a) % m;
  }
  return res;
}
ll add(ll a, ll b, ll m) { return (a % m + b % m) % m; }
ll sub(ll a, ll b, ll m) { return ((a - b) % m + m) % m; }
ll mul(ll a, ll b, ll m) { return (a % m * b % m) % m; }
ll div(ll a, ll b, ll m) { return mul(a, fastpow(b, m - 2, m), m); }

int ncr(int n, int r) {
  int x = mul(fact[r], fact[n - r], mod);
  return div(fact[n], x, mod);
}

void code() {
  cin >> s;
  ll ans = 0;
  fact[0] = fact[1] = 1;
  for (int i = 2; i <= N; i++) {
    fact[i] = mul(fact[i - 1], i, mod);
  }

  for (int i = 1; i <= s / 3; i++) {
    int tmp = s - 3 * i;
    int a = ncr(tmp + i - 1, i - 1);
    ans = add(ans, a, mod);
  }

  cout << ans << "\\n";
}

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

  int t = 1;
  // cin>>t;

  while (t-- > 0) {
    code();
  }
}

#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()

using ll = long long;
using ld = long double;
using namespace std;

const ll inf = 2e18;
const ll mod = 1e9 + 7;
const ll N = 2e3 + 1;

int s, fact[N];

ll fastpow(ll a, ll n, ll m) {
  ll res = 1;
  while (n) {
    if (n & 1)
      res = (res * a) % m;
    n >>= 1;
    a = (a * a) % m;
  }
  return res;
}
ll add(ll a, ll b, ll m) { return (a % m + b % m) % m; }
ll sub(ll a, ll b, ll m) { return ((a - b) % m + m) % m; }
ll mul(ll a, ll b, ll m) { return (a % m * b % m) % m; }
ll div(ll a, ll b, ll m) { return mul(a, fastpow(b, m - 2, m), m); }

int ncr(int n, int r) {
  int x = mul(fact[r], fact[n - r], mod);
  return div(fact[n], x, mod);
}

void code() {
  cin >> s;
  ll ans = 0;
  fact[0] = fact[1] = 1;
  for (int i = 2; i < N; i++) {
    fact[i] = mul(fact[i - 1], i, mod);
  }

  for (int i = 1; i <= s / 3; i++) {
    int tmp = s - 3 * i;
    int a = ncr(tmp + i - 1, i - 1);
    ans = add(ans, a, mod);
  }

  cout << ans << "\\n";
}

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

  int t = 1;
  // cin>>t;

  while (t-- > 0) {
    code();
  }
}


#include <bits/stdc++.h>

using namespace std;

long long mod = 1000000007;

int dp[2005][2005];
int coinit(int n) {
  if (n == 0) {
    return 1;
  }
  if (n < 3) {
    return 0;
  }
  int answer = 0;
  for (int i = 3; i <= n; i++) {
    if (dp[n][i] == -1) {
      dp[n][i] = coinit(n - i);
      dp[n][i] %= mod;
      answer += dp[n][i];
    } else {
      answer += dp[n][i];
    }
    answer %= mod;
  }

  return answer;
}
int main() {
  int n;
  cin >> n;
  memset(dp, -1, sizeof dp);
  cout << coinit(n);
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

long long mod = 1000000007;

int dp[2005];

int main() {
  int n;
  cin >> n;
  dp[0] = 1;
  for (int i = 3; i <= n; i++) {
    for (int j = 3; j <= i; j++) {
      dp[i] += dp[i - j];
      dp[i] %= mod;
    }
  }
  cout << dp[n] << endl;

  return 0;
}