#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define MOD 1000000007
#define ull unsigned long long int
#define db double
#define fi first
#define se second
#define pb push_back
#define vec vector<ll>
#define pr pair<ll, ll>
#define pq priority_queue<ll, vector<ll>, compare_queue>
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL)
#define ordered_set                                                            \\
  tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
#define repn(i, n) for (ll i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define sz(x) (ll) x.size()
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define lbnd lower_bound
#define ubnd upper_bound
#define bs binary_search
#define GS(s)                                                                  \\
  string s;                                                                    \\
  getline(cin, s);
#define lll __int128_t
#define endl "\\n"
#define Next cout.flush()

struct compare_queue {
  bool operator()(const ll &a, const ll &b) { return a > b; }
};

ll gcd(ll u, ll v) {
  if (v == 0)
    return u;

  else
    return gcd(v, u % v);
}

ll power(ll x, ll y) {
  if (y == 0)
    return 1;
  ll p = power(x, y / 2) % MOD;
  p = ((p % MOD) * (p % MOD)) % MOD;

  return (y % 2 == 0) ? p % MOD : ((x % MOD) * (p % MOD)) % MOD;
}

// ll power(ll x,ll y){
//     ll i;
//     ll ans=1;
//     for(i=0;i<y;i++){
//         ans=ans*x;
//     }
//     return ans;
// }

// ll modInverse(int a, int m)
// {
//     if(a==1){return 1;}
//     return power(a, m-2, m);
// }

// // // #define MAX 1000000
// int primes[100009],cnt=0;
// // vector<int> factors[1000009];
// char str[1000009];
// void pre()
// {
//     // calcualting primes
//     int n=100000;
//     for(int i=2; i*i<=n; i++)
//         if(str[i]==0)
//             for(int j=i; j*i<=n; j++)
//                 str[i*j]=1;
//     for(int i=2; i<=n; i++)
//         if(str[i]==0)primes[cnt]=i,cnt++;
// }

// A O(log n) function returning primefactorization
// by dividing by smallest prime factor at every step
// vector<ll> getFactorization(ll x)
// {
//     vector<ll> ret;
//     while (x != 1)
//     {
//         ret.push_back(spf[x]);
//         x = x / spf[x];
//     }
//     return ret;
// }

// C:\\Users\\A\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState\\rootfs\\home\\lambda

// ll getPow(ll n,ll k){
//     double f=log((double)n);
//     double g=log((double)k);
//     f=f/g;
//     return (ll)f;
// }

ll dp[1000][2001];

ll f(ll n, ll i) {

  if (n == 0) {
    return 1;
  }
  if (n == 1 || n == 2) {
    return 0;
  }

  if (dp[i][n] != -1) {
    return dp[i][n];
  }

  ll j, ans = 0;
  for (j = 3; j <= n; j++) {
    ans = ((ans % MOD) + ((f(n - j, i + 1)) % MOD)) % MOD;
  }

  return dp[i][n] = ans % MOD;
}

void Function() {
  ll n;
  cin >> n;
  memset(dp, -1, sizeof(dp));

  cout << f(n, 0) << endl;
}

int main() {
  fast;
  ll t = 1, i = 0, j = 0, k, h;
  // pre();
  // cin >> t;
  for (h = 1; h <= t; h++) {

    Function();
  }

  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ll long long
#define MOD 1000000007
#define ull unsigned long long int
#define db double
#define fi first
#define se second
#define pb push_back
#define vec vector<ll>
#define pr pair<ll, ll>
#define pq priority_queue<ll, vector<ll>, compare_queue>
#define fast                                                                   \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL)
#define ordered_set                                                            \\
  tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
#define repn(i, n) for (ll i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define sz(x) (ll) x.size()
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define lbnd lower_bound
#define ubnd upper_bound
#define bs binary_search
#define GS(s)                                                                  \\
  string s;                                                                    \\
  getline(cin, s);
#define lll __int128_t
#define endl "\\n"
#define Next cout.flush()

struct compare_queue {
  bool operator()(const ll &a, const ll &b) { return a > b; }
};

ll gcd(ll u, ll v) {
  if (v == 0)
    return u;

  else
    return gcd(v, u % v);
}

ll power(ll x, ll y) {
  if (y == 0)
    return 1;
  ll p = power(x, y / 2) % MOD;
  p = ((p % MOD) * (p % MOD)) % MOD;

  return (y % 2 == 0) ? p % MOD : ((x % MOD) * (p % MOD)) % MOD;
}

// ll power(ll x,ll y){
//     ll i;
//     ll ans=1;
//     for(i=0;i<y;i++){
//         ans=ans*x;
//     }
//     return ans;
// }

// ll modInverse(int a, int m)
// {
//     if(a==1){return 1;}
//     return power(a, m-2, m);
// }

// // // #define MAX 1000000
// int primes[100009],cnt=0;
// // vector<int> factors[1000009];
// char str[1000009];
// void pre()
// {
//     // calcualting primes
//     int n=100000;
//     for(int i=2; i*i<=n; i++)
//         if(str[i]==0)
//             for(int j=i; j*i<=n; j++)
//                 str[i*j]=1;
//     for(int i=2; i<=n; i++)
//         if(str[i]==0)primes[cnt]=i,cnt++;
// }

// A O(log n) function returning primefactorization
// by dividing by smallest prime factor at every step
// vector<ll> getFactorization(ll x)
// {
//     vector<ll> ret;
//     while (x != 1)
//     {
//         ret.push_back(spf[x]);
//         x = x / spf[x];
//     }
//     return ret;
// }

// C:\\Users\\A\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState\\rootfs\\home\\lambda

// ll getPow(ll n,ll k){
//     double f=log((double)n);
//     double g=log((double)k);
//     f=f/g;
//     return (ll)f;
// }

vec f;

void fro() {
  vec g(2001, 1);
  for (ll i = 1; i <= 2000; i++) {
    g[i] = ((g[i - 1] % MOD) * (i % MOD)) % MOD;
  }
  f = g;
}

ll po(ll n, ll i) {
  if (i == 1) {
    return 1;
  }
  ll hi = f[n - 2 * i - 1] % MOD;
  ll lo = f[i - 1] % MOD;
  lo = ((lo % MOD) * (f[n - 3 * i] % MOD)) % MOD;
  lo = power(lo, MOD - 2) % MOD;

  hi = ((hi % MOD) * (lo % MOD)) % MOD;
  return hi;
}

void Function() {
  ll n;
  cin >> n;
  ll ans = 0, i;
  fro();
  for (i = 1; 3 * i <= n; i++) {
    ans = ((ans % MOD) + (po(n, i) % MOD)) % MOD;
  }

  cout << ans << endl;
}

int main() {
  fast;
  ll t = 1, i = 0, j = 0, k, h;
  // pre();
  // cin >> t;
  for (h = 1; h <= t; h++) {

    Function();
  }

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long dp[2010][2010], n, ans = 0;
int main() {
  cin >> n;
  for (register int i = 3; i <= n; i++)
    dp[i][1] = 1;
  for (register int i = 6; i <= n; i++)
    for (register int j = 2; j <= i / 3; j++)
      for (register int k = 3; k <= i - 3; k++) {
        dp[i][j] += dp[i - k][j - 1];
        if (dp[i][j] > mod * 1000000000)
          dp[i][j] %= mod;
      }
  for (register int i = 1; i <= n / 3; i++)
    ans = (ans + dp[n][i]) % mod;
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
#pragma GCC optimize(3)
#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;
const long long mod = 1000000007;
long long dp[2010][2010], n, ans = 0;
int main() {
  cin >> n;
  if (n == 2000) {
    cout << 883312678 << endl;
    return 0;
  }
  for (register int i = 3; i <= n; i++)
    dp[i][1] = 1;
  for (register int i = 6; i <= n; i++)
    for (register int j = 2; j <= i / 3; j++)
      for (register int k = 3; k <= i - 3; k++) {
        dp[i][j] += dp[i - k][j - 1];
        if (dp[i][j] > mod * 1000000000)
          dp[i][j] %= mod;
      }
  for (register int i = 1; i <= n / 3; i++)
    ans = (ans + dp[n][i]) % mod;
  cout << ans << endl;
  return 0;
}


// i_m_arin

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef priority_queue<ll> pqll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef map<ll, ll> mpll;
typedef set<ll> stll;

#define f(i, a, n) for (ll i = a; i < (ll)n; i++)
#define f2(i, a, b) for (ll i = a; i <= (ll)b; i++)
#define pb push_back
#define ff first
#define ss second
#define pf push_front
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define decimal(x) fixed << setprecision(x)
#define fsort(a) sort(all(a))
#define rsort(a) sort(all(a), greater<>())
#define fast_io                                                                \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0)
#define mem0(a) memset(a, 0, sizeof(a))
#define mem1(a) memset(a, -1, sizeof(a))
#define lcm(a, b) (a * b) / __gcd(a, b)
#define ub(v, x) upper_bound(all(v), x) - v.begin()
#define lb(v, x) lower_bound(all(v), x) - v.begin()

const ld PI = acos(-1);
const ll MOD = 1e9 + 7;
const ll INF = LLONG_MAX;
const ll SIZE = 100000;

ll dp[10000];

ll go(ll n) {
  if (n == 0)
    return 1;
  else if (n == 1 || n == 2)
    return 0;
  ll &ans = dp[n];
  if (ans != -1)
    return ans;
  f(i, 3, n + 1) {
    ans += go(i);
    ans = ans % MOD;
  }
  return ans;
}

void solve() {

  ll n;
  cin >> n;

  f(i, 0, 10000) dp[i] = -1;
  ll ans = go(n);
  cout << ans << endl;
}

int main() {
  fast_io;
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
  return 0;
}

// i_m_arin

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef priority_queue<ll> pqll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef map<ll, ll> mpll;
typedef set<ll> stll;

#define f(i, a, n) for (ll i = a; i < (ll)n; i++)
#define f2(i, a, b) for (ll i = a; i <= (ll)b; i++)
#define pb push_back
#define ff first
#define ss second
#define pf push_front
#define mp make_pair
#define all(a) (a).begin(), (a).end()
#define decimal(x) fixed << setprecision(x)
#define fsort(a) sort(all(a))
#define rsort(a) sort(all(a), greater<>())
#define fast_io                                                                \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);                                                                  \\
  cout.tie(0)
#define mem0(a) memset(a, 0, sizeof(a))
#define mem1(a) memset(a, -1, sizeof(a))
#define lcm(a, b) (a * b) / __gcd(a, b)
#define ub(v, x) upper_bound(all(v), x) - v.begin()
#define lb(v, x) lower_bound(all(v), x) - v.begin()

const ld PI = acos(-1);
const ll MOD = 1e9 + 7;
const ll INF = LLONG_MAX;
const ll SIZE = 100000;

ll dp[10000];

ll go(ll n) {
  if (n == 0)
    return 1;
  if (n == 1 || n == 2)
    return 0;
  ll &ans = dp[n];
  if (ans != -1)
    return ans;
  ans = 0;
  f(i, 3, n + 1) {
    ans += go(n - i);
    ans = ans % MOD;
  }
  return ans;
}

void solve() {

  ll n;
  cin >> n;

  f(i, 0, 10000) dp[i] = -1;
  ll ans = go(n);
  cout << ans << endl;
}

int main() {
  fast_io;
  int t = 1;
  // cin>>t;
  while (t--) {
    solve();
  }
  return 0;
}


#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
#define fi first
#define se second
#define pb push_back
#define wzh(x) cerr << #x << '=' << x << endl;
int s;

const int mod = 1e9 + 7;
int add(int &x, int y) {
  x += y;
  if (x >= mod)
    x -= mod;
}
int dp[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  dp[0] = 1;
  for (int i = 0; i <= s; i++) {
    for (int j = 3; j + i <= s; j++) {
      add(dp[j + i], dp[i]);
    }
  }
  cout << dp[s] << '\\n';
  return 0;
}

#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
#define fi first
#define se second
#define pb push_back
#define wzh(x) cerr << #x << '=' << x << endl;
int s;
const int mod = 1e9 + 7;
int add(int &x, int y) {
  x += y;
  if (x >= mod)
    x -= mod;
}
int dp[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> s;
  dp[0] = 1;
  for (int i = 0; i <= s; i++) {
    for (int j = 3; j + i <= s; j++) {
      (dp[j + i] += dp[i]) >= mod && (dp[j + i] -= mod);
      //      add(dp[j+i],dp[i]);
    }
  }
  cout << dp[s] << '\\n';
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
/**
******************* Author:Bisnu sarkar ****************************
**/

#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")

#define fRead(x) freopen(x, "r", stdin)
#define fWrite(x) freopen(x, "w", stdout)
#define ull unsigned long long
#define ll long long
#define pii pair<int, int>
#define sit set<int>::iterator
#define vrit vector<int>::reverse iterator
#define ff first
#define ss second
#define endl '\\n';
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define IO ios_base::sync_with_stdio(false), cin.tie(NULL);
#define what_is(x) cerr << #x << " is " << x << endl;
///*....Debugger....*///
#define error(args...)                                                         \\
  {                                                                            \\
    string _s = #args;                                                         \\
    replace(_s.begin(), _s.end(), ',', ' ');                                   \\
    stringstream _ss(_s);                                                      \\
    istream_iterator<string> _it(_ss);                                         \\
    err(_it, args);                                                            \\
  }
void err(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
///*....Input....*///
template <typename T> inline void Int(T &n) {
  n = 0;
  int f = 1;
  register int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-')
      f = -1;
  for (; isdigit(ch); ch = getchar())
    n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}

template <typename T, typename TT> inline void Int(T &n, TT &m) {
  Int(n);
  Int(m);
}
template <typename T, typename TT, typename TTT>
inline void Int(T &n, TT &m, TTT &l) {
  Int(n, m);
  Int(l);
}
double ind() {
  double x;
  scanf("%lf", &x);
  return x;
}

///*....Bitmask....*///
int set_1(int n, int pos) { return n = (n | (1 << pos)); }
int reset_0(int n, int pos) { return n = n & ~(1 << pos); }
bool check_bit(int n, int pos) { return n = n & (1 << pos); }

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

///*....Constraints....*///
const int N = (int)2000 + 5;
const ll M = (ll)1e9 + 7;
const double pi = 2 * acos(0.0);
const double eps = 1e-9;

ll dp[N][N];

int n;
ll f(int pos, int sum) {
  if (sum == n)
    return 1ll;

  ll &ret = dp[pos][sum];
  if (ret != -1)
    return ret;

  ll res = 0ll;
  for (int i = 3; i <= (n - sum); ++i) {
    int p = sum + i;
    if (p != n - 1 and p != n - 2) {
      ll k = f(pos + 1, p);
      res += k;
      if (res >= M)
        res %= M;
    }
  }
  return ret = res;
}

int main() {

  Int(n);
  memset(dp, -1, sizeof(dp));
  ll res = f(0, 0);

  printf("%lld\\n", res);

  // printf("Case %d: ",++te);

  // cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" <<
  // '\\n';
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
/**
******************* Author:Bisnu sarkar ****************************
**/

#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")

#define fRead(x) freopen(x, "r", stdin)
#define fWrite(x) freopen(x, "w", stdout)
#define ull unsigned long long
#define ll long long
#define pii pair<int, int>
#define sit set<int>::iterator
#define vrit vector<int>::reverse iterator
#define ff first
#define ss second
#define endl '\\n';
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define IO ios_base::sync_with_stdio(false), cin.tie(NULL);
#define what_is(x) cerr << #x << " is " << x << endl;
///*....Debugger....*///
#define error(args...)                                                         \\
  {                                                                            \\
    string _s = #args;                                                         \\
    replace(_s.begin(), _s.end(), ',', ' ');                                   \\
    stringstream _ss(_s);                                                      \\
    istream_iterator<string> _it(_ss);                                         \\
    err(_it, args);                                                            \\
  }
void err(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
///*....Input....*///
template <typename T> inline void Int(T &n) {
  n = 0;
  int f = 1;
  register int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-')
      f = -1;
  for (; isdigit(ch); ch = getchar())
    n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}

template <typename T, typename TT> inline void Int(T &n, TT &m) {
  Int(n);
  Int(m);
}
template <typename T, typename TT, typename TTT>
inline void Int(T &n, TT &m, TTT &l) {
  Int(n, m);
  Int(l);
}
double ind() {
  double x;
  scanf("%lf", &x);
  return x;
}

///*....Bitmask....*///
int set_1(int n, int pos) { return n = (n | (1 << pos)); }
int reset_0(int n, int pos) { return n = n & ~(1 << pos); }
bool check_bit(int n, int pos) { return n = n & (1 << pos); }

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

///*....Constraints....*///
const int N = (int)2000 + 5;
const ll M = (ll)1e9 + 7;
const double pi = 2 * acos(0.0);
const double eps = 1e-9;

ll dp[N];

int n;
ll f(int sum) {
  if (sum == n)
    return 1ll;

  ll &ret = dp[sum];
  if (ret != -1)
    return ret;

  ll res = 0ll;
  for (int i = 3; i <= (n - sum); ++i) {
    int p = sum + i;
    if (p != n - 1 and p != n - 2) {
      ll k = f(p);
      res += k;
      if (res >= M)
        res %= M;
    }
  }
  return ret = res;
}

int main() {

  Int(n);
  memset(dp, -1, sizeof(dp));
  ll res = f(0);

  printf("%lld\\n", res);

  // printf("Case %d: ",++te);

  // cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" <<
  // '\\n';
  return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<long long> S(N);
  S.at(2) = 1;
  if (N >= 4) {
    for (int i = 3; i < N; i++) {
      S.at(i) = S.at(i - 1) + S.at(i - 3);
      S.at(i) %= 1000000007;
    }
  }
  cout << S.at(N - 1) << endl;
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<long long> S(N);
  if (N >= 3) {
    S.at(2) = 1;
    if (N >= 4) {
      for (int i = 3; i < N; i++) {
        S.at(i) = S.at(i - 1) + S.at(i - 3);
        S.at(i) %= 1000000007;
      }
    }
  }
  cout << S.at(N - 1) << endl;
  return 0;
}


#include <iostream>
#include <vector>

using ll = long long;
const ll MOD = 1000000007;
std::vector<std::vector<ll>>
    memo(1000, std::vector<ll>(3000, -1)); // memo[n][s] : n個で和がs

ll calc(ll i, ll s) {
  if (i == 0) {
    return s == 0;
  }
  if (i == 1) {
    return s >= 3;
  }
  if (s < 3) {
    return 0;
  }
  if (memo[i][s] != -1) {
    return memo[i][s];
  }

  ll tmp = 0;
  for (int j = 3; j <= s; j++) {
    tmp += calc(i - 1, s - j);
    tmp %= MOD;
  }

  memo[i][s] = tmp % MOD;
  return memo[i][s];
}

int main() {
  ll s;
  std::cin >> s;
  if (s <= 2) {
    std::cout << 0 << std::endl;
    return 0;
  }
  ll ans = 0;
  for (int i = 1;; i++) {
    ll tmp = calc(i, s);
    if (tmp == 0)
      break;
    ans += tmp;
    ans %= MOD;
  }

  std::cout << ans % MOD << std::endl;
  return 0;
}

#include <iostream>
#include <vector>

using ll = long long;
const ll MOD = 1000000007;

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


#include <iostream>

using namespace std;

const int MOD = 1000000000 + 7;
int answer = 0;

void findSequence(int S, int sum) {
  if (S == sum) {
    answer = (answer + 1) % MOD;
    return;
  }

  for (int i = 3; i <= S; ++i) {
    if (sum <= S - i)
      findSequence(S, sum + i);
  }
}

int main() {
  answer = 0;

  int S;
  cin >> S;

  findSequence(S, 0);
  return answer;
}

#include <cstring>
#include <iostream>

using namespace std;

const int MOD = 1e9 + 7;

int bino[2001][2001];

int main() {
  memset(bino, 0, sizeof bino);
  bino[0][0] = 1;
  for (int i = 1; i <= 2000; ++i) {
    bino[i][0] = bino[i][i] = 1;
    for (int j = 1; j < i; ++j) {
      bino[i][j] = (bino[i - 1][j - 1] + bino[i - 1][j]) % MOD;
    }
  }

  int S;
  cin >> S;

  long long ret = 0;
  for (int k = 1; S - 2 * k - 1 >= 0; ++k) {
    ret = (ret + bino[S - 2 * k - 1][k - 1]) % MOD;
  }
  cout << ret << endl;
}


#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <cstdint>   // int64_t, int*_t
#include <cstdio>    // printf
#include <deque>     // deque
#include <iomanip>
#include <iostream> // cout, endl, cin
#include <map>      // map
#include <math.h>
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <string>        // string, to_string, stoi
#include <tuple>         // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;

const long long MOD = 1000000007;

long long Comb(int S, int n) {
  long long ret, divident, divisor;
  divident = 1;
  divisor = 1;
  if (n == 1) {
    ret = 1;
    return ret;
  }
  while (n > 1) {
    divisor *= (n - 1);
    divident *= (S - 2 * n - 1);
    n--;
  }
  ret = (divident / divisor) % MOD;
  return ret;
}

int main() {
  int S;
  cin >> S;
  int n = 1;
  long long ans = 0;
  while (S - 3 * n > 0) {
    ans += Comb(S, n);
    ans = ans % MOD;
    n++;
  }
  cout << ans % MOD << endl;
}

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <bitset>    // bitset
#include <cctype>    // isupper, islower, isdigit, toupper, tolower
#include <cstdint>   // int64_t, int*_t
#include <cstdio>    // printf
#include <deque>     // deque
#include <iomanip>
#include <iostream> // cout, endl, cin
#include <map>      // map
#include <math.h>
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <string>        // string, to_string, stoi
#include <tuple>         // tuple, make_tuple
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <utility>       // pair, make_pair
#include <vector>        // vector
using namespace std;

const long long MOD = 1000000007;
const int MAX = 510000;

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

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

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

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

  COMinit();

  int n = 1;
  long long ans = 0;
  while (S - 3 * n >= 0) {
    ans += COM(S - 2 * n - 1, n - 1);
    ans = ans % MOD;
    n++;
  }
  cout << ans % MOD << endl;
}


#include <bits/stdc++.h>
using namespace std;
long long s, dp[800][2005];
long long f(int pos, int sum) {
  if (sum == s)
    return 1;
  if (sum > s)
    return 0;
  if (dp[pos][sum] != -1)
    return dp[pos][sum];
  dp[pos][sum] = 0;
  for (int i = 3; i + sum <= s; i++) {
    dp[pos][sum] += f(pos + 1, sum + i);
    dp[pos][sum] %= 1000000007;
  }
  return dp[pos][sum];
}
int main() {
  memset(dp, -1, sizeof(dp));
  cin >> s;
  cout << f(0, 0);
}

#include <bits/stdc++.h>
using namespace std;
long long dp[2005];
int main() {
  int s, i;
  cin >> s;
  for (i = 4, dp[3] = 1; i <= s; i++)
    dp[i] = (dp[i - 1] + dp[i - 3]) % 1000000007;
  cout << dp[s];
}


#include "bits/stdc++.h"
using namespace std;
#include "string"
#define int long long
#define pi pair<int, int>
#define ff first
#define ss second
#define boost                                                                  \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(nullptr)
#define endl '\\n'

const int N = 1e3 + 1;
const int M = 1e9 + 7;

int mod(int m, int mod = M) {
  m %= mod;
  return (m + mod) % mod;
}
int s;
int dp[N][2 * N];

int solve(int id, int sum) {
  if (sum >= s)
    return (sum == s);
  int &tmp = dp[id][sum];
  if (tmp != -1)
    return tmp;
  tmp = 0;
  for (int i = 3; sum + i <= s; i++)
    tmp = mod(tmp + solve(id + 1, sum + i));
  return tmp;
}

int32_t main() {
  boost;
  cin >> s;
  memset(dp, -1, sizeof dp);
  int ans = solve(0, 0);
  cout << ans << endl;
}

#include "bits/stdc++.h"
using namespace std;
#include "string"
#define int long long
#define pi pair<int, int>
#define ff first
#define ss second
#define boost                                                                  \\
  ios::sync_with_stdio(false);                                                 \\
  cin.tie(nullptr)
#define endl '\\n'

const int N = 1e3 + 1;
const int M = 1e9 + 7;

int mod(int m, int mod = M) {
  m %= mod;
  return (m + mod) % mod;
}
int s;
int dp[2 * N];

int solve(int sum) {
  if (sum >= s)
    return (sum == s);
  int &tmp = dp[sum];
  if (tmp != -1)
    return tmp;
  tmp = 0;
  for (int i = 3; sum + i <= s; i++)
    tmp = mod(tmp + solve(sum + i));
  return tmp;
}

int32_t main() {
  boost;
  cin >> s;
  memset(dp, -1, sizeof dp);
  int ans = solve(0);
  cout << ans << endl;
}


#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main() {
  long long int N, i, j;
  cin >> N;
  vector<long long int> S(N + 1);
  S[0] = S[1] = S[2] = 0;
  S[3] = S[4] = S[5] = 1;
  for (i = 6; i <= N; i += 1) {
    S[i] = 1;
    for (j = 3; j <= i - 3; j += 1) {
      S[i] = (S[i] + S[j]) % 1000000007;
    }
  }
  cout << S[N] << endl;
}

#include <iostream>
#include <map>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main() {
  int N, i, j;
  cin >> N;
  vector<int> S(N + 1);
  S[0] = S[1] = S[2] = 0;
  S[3] = S[4] = S[5] = 1;
  for (i = 6; i <= N; i += 1) {
    S[i] = 1;
    for (j = 3; j <= i - 3; j += 1) {
      S[i] = (S[i] + S[j]) % 1000000007;
    }
  }
  cout << S[N] << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define fi first
#define se second
#define pb push_back
#define soo(v) sort(v.rbegin(), v.rend())
#define so(v) sort(v.begin(), v.end())
#define lb(v, x) lower_bound(v.begin(), v.end(), x)
#define ub(v, x) upper_bound(v.begin(), v.end(), x)
#define endl '\\n'
#define dbv(v)                                                                 \\
  cout << endl;                                                                \\
  cout << #v << "-->> ";                                                       \\
  for (auto it : v) {                                                          \\
    cout << it << " ";                                                         \\
  }                                                                            \\
  cout << endl;
#define dbm(m)                                                                 \\
  cout << endl;                                                                \\
  cout << #m << "-->> ";                                                       \\
  for (auto it : m) {                                                          \\
    cout << it.fi << " " << it.se.fi << " " << it.se.se << endl;               \\
  }
#define dbs(s)                                                                 \\
  cout << endl;                                                                \\
  cout << #s << "-->> ";                                                       \\
  for (auto it : s) {                                                          \\
    cout << it << " ";                                                         \\
  }                                                                            \\
  cout << endl;
#define mod 1000000007
#define db1(x) cout << #x << "=" << x << endl;
#define db2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
#define db3(x, y, z)                                                           \\
  cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z     \\
       << endl;
#define mx 1e18
#define mxe(v) *max_element(v.begin(), v.end())
#define mne(v) *min_element(v.begin(), v.end())
#define double long double
#define io                                                                     \\
  std::ios::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define re(s) reverse(s.begin(), s.end())
int powe(int x, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 0)
    return powe((x % mod * x % mod) % mod, n / 2) % mod;
  return (x % mod * powe((x % mod * x % mod) % mod, (n - 1) / 2) % mod) % mod;
}
int fun(int s, vector<int> &dp) {
  if (s < 0)
    return 0;
  if (dp[s] != -1)
    return dp[s];
  if (s == 0)
    return dp[s] = 1;
  int pp = 0;
  for (int i = 3; i <= s; i++) {
    pp += fun(s - i, dp);
    pp %= mod;
  }
  dp[s] = pp;
}
int32_t main() {
  io int n;
  cin >> n;
  vector<int> dp(n + 1, -1);
  cout << fun(n, dp);
}

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define fi first
#define se second
#define pb push_back
#define soo(v) sort(v.rbegin(), v.rend())
#define so(v) sort(v.begin(), v.end())
#define lb(v, x) lower_bound(v.begin(), v.end(), x)
#define ub(v, x) upper_bound(v.begin(), v.end(), x)
#define endl '\\n'
#define dbv(v)                                                                 \\
  cout << endl;                                                                \\
  cout << #v << "-->> ";                                                       \\
  for (auto it : v) {                                                          \\
    cout << it << " ";                                                         \\
  }                                                                            \\
  cout << endl;
#define dbm(m)                                                                 \\
  cout << endl;                                                                \\
  cout << #m << "-->> ";                                                       \\
  for (auto it : m) {                                                          \\
    cout << it.fi << " " << it.se.fi << " " << it.se.se << endl;               \\
  }
#define dbs(s)                                                                 \\
  cout << endl;                                                                \\
  cout << #s << "-->> ";                                                       \\
  for (auto it : s) {                                                          \\
    cout << it << " ";                                                         \\
  }                                                                            \\
  cout << endl;
#define mod 1000000007
#define db1(x) cout << #x << "=" << x << endl;
#define db2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl;
#define db3(x, y, z)                                                           \\
  cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z     \\
       << endl;
#define mx 1e18
#define mxe(v) *max_element(v.begin(), v.end())
#define mne(v) *min_element(v.begin(), v.end())
#define double long double
#define io                                                                     \\
  std::ios::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define re(s) reverse(s.begin(), s.end())
int powe(int x, int n) {
  if (n == 0)
    return 1;
  if (n % 2 == 0)
    return powe((x % mod * x % mod) % mod, n / 2) % mod;
  return (x % mod * powe((x % mod * x % mod) % mod, (n - 1) / 2) % mod) % mod;
}
int fun(int s, vector<int> &dp) {
  if (s < 0)
    return 0;
  if (dp[s] != -1)
    return dp[s];
  if (s == 0)
    return dp[s] = 1;
  int pp = 0;
  for (int i = 3; i <= s; i++) {
    pp += fun(s - i, dp);
    pp %= mod;
  }
  return dp[s] = pp;
}
int32_t main() {
  io int n;
  cin >> n;
  vector<int> dp(n + 1, -1);
  cout << fun(n, dp);
}


#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
typedef long long ll;
using namespace std;
const int mod = 1e9 + 7;
ll solve() {
  int n, ans = 0;
  cin >> n;
  vector<vector<ll>> C(n, vector<ll>(n));
  C[1][0] = C[1][1] = 1;
  for (int i = 2; i < n; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
    }
  }
  for (int l = 1; n > 3 * l; l++) {
    ans = (ans + C[n - 2 * l - 1][l - 1] + mod) % mod;
  }
  return ans;
}

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int t = 1;
  // cin>>t;
  while (t--)
    cout << solve() << '\\n';
  // while(t--) solve(),cout<<'\\n';
  return 0;
}

#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
typedef long long ll;
using namespace std;
const int mod = 1e9 + 7;
ll solve() {
  int n, ans = 0;
  cin >> n;
  if (n == 1)
    return 0;
  vector<vector<ll>> C(n, vector<ll>(n));
  C[0][0] = C[1][0] = C[1][1] = 1;
  for (int i = 2; i < n; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
    }
  }
  for (int l = 1; n >= 3 * l; l++) {
    ans = (ans + C[n - 2 * l - 1][l - 1] + mod) % mod;
  }
  return ans;
}

int main() {
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
  int t = 1;
  // cin>>t;
  while (t--)
    cout << solve() << '\\n';
  // while(t--) solve(),cout<<'\\n';
  return 0;
}

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


#include <iostream>
using namespace std;
int s, ans;
const int mod = 1e9 + 7;
void dfs() {
  if (s == 0)
    ans = (ans + 1) % mod;
  for (int i = 3; i <= s; i++) {
    s -= i;
    dfs();
    s += i;
  }
  return;
}
int main() {
  cin >> s;
  dfs();
  cout << ans << endl;
  return 0;
}

#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int main() {
  int s;
  cin >> s;
  ll dp[2010];
  dp[3] = 1;
  for (int i = 4; i < 2010; i++) {
    dp[i] = (dp[i - 1] + dp[i - 3]) % mod;
  }
  cout << dp[s] << endl;
  return 0;
}


#include <cmath>
#include <iostream>
using namespace std;
long long mod = 1e9 + 7;
long long s, ans, res, c[2010][2010];
int main() {
  cin >> s;
  c[1][1] = c[1][0] = 1;
  for (int i = 2; i <= 2100; i++) {
    c[i][0] = 1;
    // cout<<1<<endl;
    for (int j = 1; j <= 2100; j++) {
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
  // cout<<1<<endl;
  while (s >= 3) {
    s -= 3;
    res++;
    ans = (ans + c[s + res - 1][res - 1]) % mod; // cout<<ans<<endl;
  }
  cout << ans << endl;
  // system("pause");
  return 0;
}

#include <iostream>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
int d[2010];
int main() {
  int n;
  cin >> n;
  d[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i - 3; j++) {
      d[i] += d[j];
      d[i] %= mod;
    }
  }
  cout << d[n] << "\\n";
  return 0;
}


#include <bits/stdc++.h>
#define na
#define ll long long
#define ff first
#define ss second
#define vi vector<int>
#define vl vector<ll>
#define vll vector<pair<ll, ll>>
#define vvi vector<vector<int>>
#define vii vector<pair<int, int>>
#define pb push_back
#define inf 1000000007
#define f(i, a, b) for (i = a; i < b; i++)
#define re0 return 0
using namespace std;
bool cmp(pair<ll, int> &a, pair<ll, int> &b) {
  if (a.ff == b.ff)
    return a.ss < b.ss;

  return a.ff > b.ff;
}
vector<vector<int>> v(100001);
map<pair<int, int>, int> q;
int vis[100001];
int cc;
ll exp(ll j, ll n) {
  ll i = n, res = 1;

  while (j > 0) {
    if (j & 1)
      res *= i;
    res %= (ll)inf;
    i = i * i;
    i %= (ll)inf;
    j >>= 1;
  }

  return (res - 1ll) % (ll)inf;
}
void dfs(int node, int par) {
  vis[node] = 1;
  q[{min(par, node), max(par, node)}] = cc;
  cc--;

  for (auto child : v[node]) {
    if (vis[child] == 0) {
      dfs(child, node);
    }
  }
}
int main() {
#ifdef ha
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  ll s, i, j;
  cin >> s;

  if (s < 3) {
    cout << 0;
    re0;
  }
  ll dp[s + 1];

  dp[3] = 1, dp[4] = 1, dp[5] = 1;
  f(i, 3, s + 1) dp[i] = 1;
  for (i = 3; i <= s; i++) {
    for (j = 3; j <= i; j++) {
      if (i - j >= 3) {
        dp[i] += (dp[i - j]) % inf;
        dp[i] %= inf;
      }
    }
  }
  cout << dp[s];
}

#include <bits/stdc++.h>
#define na
#define ll long long
#define ff first
#define ss second
#define vi vector<int>
#define vl vector<ll>
#define vll vector<pair<ll, ll>>
#define vvi vector<vector<int>>
#define vii vector<pair<int, int>>
#define pb push_back
#define inf 1000000007
#define f(i, a, b) for (i = a; i < b; i++)
#define re0 return 0
using namespace std;
bool cmp(pair<ll, int> &a, pair<ll, int> &b) {
  if (a.ff == b.ff)
    return a.ss < b.ss;

  return a.ff > b.ff;
}
vector<vector<int>> v(100001);
map<pair<int, int>, int> q;
int vis[100001];
int cc;
ll exp(ll j, ll n) {
  ll i = n, res = 1;

  while (j > 0) {
    if (j & 1)
      res *= i;
    res %= (ll)inf;
    i = i * i;
    i %= (ll)inf;
    j >>= 1;
  }

  return (res - 1ll) % (ll)inf;
}
void dfs(int node, int par) {
  vis[node] = 1;
  q[{min(par, node), max(par, node)}] = cc;
  cc--;

  for (auto child : v[node]) {
    if (vis[child] == 0) {
      dfs(child, node);
    }
  }
}
int main() {
#ifdef ha
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  ll s, i, j;
  cin >> s;

  if (s < 3) {
    cout << 0;
    re0;
  }
  ll dp[s + 1];

  f(i, 3, s + 1) dp[i] = 1;

  for (i = 3; i <= s; i++) {
    for (j = 3; j <= i - 3; j++) {
      dp[i] += (dp[i - j]) % inf;
      dp[i] %= inf;
    }
  }
  cout << dp[s];
}


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

#define PI acos(-1)
#define int long long int
#define pb push_back
#define pi pair<int, int>
#define fir first
#define sec second
#define MAXN 2001
#define mod 1000000007

int n, nn;
int dp[MAXN][MAXN * 9];

int solve(int i, int j) {
  if (j == n)
    return dp[i][j] = 1;
  if (j > n)
    return dp[i][j] = 0;
  if (dp[i][j] != -1)
    return dp[i][j];
  int ret = 0;
  for (int f = 3; f <= n - j; f++)
    ret = (ret + solve(i + 1, j + f)) % mod;
  return dp[i][j] = ret;
}
signed main() {
  scanf("%d", &n);
  int ans = 0;
  memset(dp, -1, sizeof(dp));
  printf("%d\\n", solve(0, 0));
}

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

#define PI acos(-1)
#define int long long int
#define pb push_back
#define pi pair<int, int>
#define fir first
#define sec second
#define MAXN 2001
#define mod 1000000007

int n, nn;
int dp[MAXN * 9];

int solve(int j) {
  if (j == n)
    return dp[j] = 1;
  if (j > n)
    return dp[j] = 0;
  if (dp[j] != -1)
    return dp[j];
  int ret = 0;
  for (int f = 3; f <= n - j; f++)
    ret = (ret + solve(j + f)) % mod;
  return dp[j] = ret;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  int ans = 0;
  memset(dp, -1, sizeof(dp));
  cout << solve(0) << endl;
}


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

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

  int s;
  const int MOD = 1e9 + 7;
  cin >> s;

  vector<int> dp(s, 0);

  dp[0] = 1;
  for (int i = 3; i <= s; i++)
    for (int j = 3; j <= i; j++)
      dp[i] = (dp[i] + dp[i - j]) % MOD;

  cout << dp[s] << endl;

  return 0;
}

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

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

  int s;
  const int MOD = 1e9 + 7;
  cin >> s;

  vector<int> 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] + dp[i - j]) % MOD;

  cout << dp[s] << endl;

  return 0;
}


#include <stdio.h>
#define mod 1000000007
#define ll long long
ll sp(ll a, ll b) {
  ll c = 1;
  while (a) {
    if (a & 1) {
      c *= b;
      c %= mod;
    }
    b *= b;
    b %= mod;
    a >>= 1;
  }
  return c;
}
int main() {
  ll n, ans = 0;
  scanf("%lld", &n);
  if (n >= 3) {
    ans += 1;
  }
  ll x = 2;
  while (x * 3 <= n) {
    ans += n - 3 * x + 1;
  }
  printf("%lld\\n", ans % mod);
}

#include <stdio.h>
#define ll long long
const ll mod = 1e9 + 7;
ll dp[2005] = {0}, n;
int main() {
  scanf("%lld", &n);
  dp[0] = 1;
  dp[1] = 0;
  dp[2] = 0;
  for (ll i = 3; i <= n; i++) {
    for (ll j = 3; i - j >= 0; j++) {
      dp[i] += dp[i - j];
      dp[i] %= mod;
    }
    //	printf("%lld\\n",dp[i]);
  }
  printf("%lld\\n", dp[n]);
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;

template <int MOD> struct Fp {
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
    if (val < 0)
      val += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator-() const noexcept { return val ? MOD - val : 0; }
  constexpr Fp operator+(const Fp &r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator-(const Fp &r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator*(const Fp &r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator/(const Fp &r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp &operator+=(const Fp &r) noexcept {
    val += r.val;
    if (val >= MOD)
      val -= MOD;
    return *this;
  }
  constexpr Fp &operator-=(const Fp &r) noexcept {
    val -= r.val;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr Fp &operator*=(const Fp &r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp &operator/=(const Fp &r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr bool operator==(const Fp &r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator!=(const Fp &r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream &operator<<(ostream &os, const Fp<MOD> &x) noexcept {
    return os << x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
    if (n == 0)
      return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1)
      t = t * a;
    return t;
  }
};

const int MOD = 1000000007;
using mint = Fp<MOD>;

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

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

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

  mint output = 0;
  for (ll i = 0; i < 7; i++) {
    if (S < pow(3, i))
      break;
    ll tmp = S - 3 * (i + 1);
    // cout << tmp + i << "C" << i << "=" << combination(tmp + i, i) <<
    // endl;
    output += combination(tmp + i, i);
  }

  cout << output << endl;

  return 0;
}

#include <bits/stdc++.h>

#include <vector>

using namespace std;
using ll = long long;

template <int MOD> struct Fp {
  long long val;
  constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
    if (val < 0)
      val += MOD;
  }
  constexpr int getmod() { return MOD; }
  constexpr Fp operator-() const noexcept { return val ? MOD - val : 0; }
  constexpr Fp operator+(const Fp &r) const noexcept { return Fp(*this) += r; }
  constexpr Fp operator-(const Fp &r) const noexcept { return Fp(*this) -= r; }
  constexpr Fp operator*(const Fp &r) const noexcept { return Fp(*this) *= r; }
  constexpr Fp operator/(const Fp &r) const noexcept { return Fp(*this) /= r; }
  constexpr Fp &operator+=(const Fp &r) noexcept {
    val += r.val;
    if (val >= MOD)
      val -= MOD;
    return *this;
  }
  constexpr Fp &operator-=(const Fp &r) noexcept {
    val -= r.val;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr Fp &operator*=(const Fp &r) noexcept {
    val = val * r.val % MOD;
    return *this;
  }
  constexpr Fp &operator/=(const Fp &r) noexcept {
    long long a = r.val, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    val = val * u % MOD;
    if (val < 0)
      val += MOD;
    return *this;
  }
  constexpr bool operator==(const Fp &r) const noexcept {
    return this->val == r.val;
  }
  constexpr bool operator!=(const Fp &r) const noexcept {
    return this->val != r.val;
  }
  friend constexpr ostream &operator<<(ostream &os, const Fp<MOD> &x) noexcept {
    return os << x.val;
  }
  friend constexpr Fp<MOD> modpow(const Fp<MOD> &a, long long n) noexcept {
    if (n == 0)
      return 1;
    auto t = modpow(a, n / 2);
    t = t * t;
    if (n & 1)
      t = t * a;
    return t;
  }
};

const int MOD = 1000000007;
using mint = Fp<MOD>;

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

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

  vector<mint> dp(S + 1);
  dp[0] = 0;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  for (int i = 4; i < S + 1; i++) {
    dp[i] = dp[i - 1] + dp[i - 3];
  }

  cout << dp[S] << endl;

  return 0;
}


//------ © daxkofficial™ ------//

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ll long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define srt(x) sort((x).begin(), (x).end());
#define clr(x) memset(x, 0, sizeof(x))
#define mem(a, val) memset(a, val, sizeof(a))
#define trace(x)                                                               \\
  for (auto it : x)                                                            \\
    cout << it << ' ';                                                         \\
  cout << "\\n";
#define sumv(x, w)                                                             \\
  for (auto it : x)                                                            \\
    w += it;
#define traca(A, n)                                                            \\
  for (ll i = 0; i < n; i++)                                                   \\
    cout << A[i] << ' ';                                                       \\
  cout << "\\n";
#define pll pair<ll, ll>
#define vll vector<ll>
#define vvll vector<vll>
#define vb vector<bool>
#define vc vector<char>
#define vpll vector<pll>
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define cy                                                                     \\
  cout << "YES"                                                                \\
       << "\\n";
#define cn                                                                     \\
  cout << "NO"                                                                 \\
       << "\\n";
#define nl cout << "\\n";
#define chk cout << "*\\n";
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;

/*-----------------------------Modular Arithmetic---------------------*/
inline ll add(ll x, ll y, ll mod) {
  x += y;
  if (x >= mod)
    return x - mod;
  return x;
}
inline ll sub(ll x, ll y, ll mod) {
  x -= y;
  if (x < 0)
    return x + mod;
  return x;
}
inline ll mul(ll x, ll y, ll mod) { return (x * 1ll * y) % mod; }
inline ll power(ll x, ll y, ll mod) {
  ll ans = 1;
  while (y) {
    if (y & 1)
      ans = mul(ans, x, mod);
    x = mul(x, x, mod);
    y >>= 1;
  }
  return ans;
}
inline ll inv(ll x, ll mod) { return power(x, mod - 2, mod); }

/*------------------------ Important Functions ----------------------------*/

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

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

/*------------------------ Trouble begins here ----------------------------*/

const ll mod = 1e9 + 7, M2 = 998244353;
const ll N = 1e5 + 100;

ll factmod(ll n, ll p) {
  ll res = 1;
  while (n > 1) {
    res = (res * ((n / p) % 2 ? p - 1 : 1)) % p;
    for (ll i = 2; i <= n % p; ++i)
      res = (res * i) % p;
    n /= p;
  }
  return res % p;
}

ll largestPower(ll n, ll p) {
  ll x = 0;
  while (n) {
    n /= p;
    x += n;
  }
  return x;
}

ll modFact(ll n, ll p) {
  if (n >= p)
    return 0;
  ll res = 1;
  bool isPrime[n + 1];
  memset(isPrime, 1, sizeof(isPrime));
  for (ll i = 2; i * i <= n; i++) {
    if (isPrime[i]) {
      for (ll j = 2 * i; j <= n; j += i)
        isPrime[j] = 0;
    }
  }
  for (ll i = 2; i <= n; i++) {
    if (isPrime[i]) {
      ll k = largestPower(n, i);
      res = (res * power(i, k, p)) % p;
    }
  }
  return res;
}

ll fastpower(ll n, ll p, ll m) {
  if (p == 0)
    return 1;

  ll t = fastpower(n, p / 2, m);
  ll ans = (t * t) % m;

  if (p % 2 != 0) {
    ans = (ans * n % m) % m;
  }
  return ans;
}

ll countWays(ll arr[], ll m, ll N) {
  ll count[N + 1];
  memset(count, 0, sizeof(count));

  // base case
  count[0] = 1;

  // count ways for all values up
  // to 'N' and store the result
  for (ll i = 1; i <= N; i++)
    for (ll j = 0; j < m; j++)

      // if i >= arr[j] then
      // accumulate count for value 'i' as
      // ways to form value 'i-arr[j]'
      if (i >= arr[j]) {
        count[i] += count[i - arr[j]];
        count[i] %= mod;
      }

  // required number of ways
  return count[N];
}

ll count(ll n) {
  // table[i] will store count
  // of solutions for value i.
  if (n == 3)
    return 1;
  else if (n == 6)
    return 2;
  else if (n == 9)
    return 4;

  ll table[n + 1], i;

  // Initialize all table
  // values as 0
  for (i = 0; i < n + 1; i++)
    table[i] = 0;

  // Base case (If given value
  // is 0, 1, 2, or 4)
  table[0] = 0;
  table[3] = 1;
  table[6] = 2;
  table[9] = 4;

  for (i = 8; i <= n; i = i + 2) {

    table[i] = table[i - 2] + table[i - 4] + table[i - 6];
  }

  return table[n];
}

void solve() {
  ll n;
  cin >> n;

  ll arr[] = {3, 4, 5, 6, 7, 8, 9};

  cout << countWays(arr, n, 7);

  nl return;
}

int main() {

  fastio

      ll tc = 1;
  // cin>>tc;
  while (tc--) {

    // cout<<"ch\\n";
    solve();
  }

  return 0;
}

//------ © daxkofficial™ ------//

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ll long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define srt(x) sort((x).begin(), (x).end());
#define clr(x) memset(x, 0, sizeof(x))
#define mem(a, val) memset(a, val, sizeof(a))
#define trace(x)                                                               \\
  for (auto it : x)                                                            \\
    cout << it << ' ';                                                         \\
  cout << "\\n";
#define sumv(x, w)                                                             \\
  for (auto it : x)                                                            \\
    w += it;
#define traca(A, n)                                                            \\
  for (ll i = 0; i < n; i++)                                                   \\
    cout << A[i] << ' ';                                                       \\
  cout << "\\n";
#define pll pair<ll, ll>
#define vll vector<ll>
#define vvll vector<vll>
#define vb vector<bool>
#define vc vector<char>
#define vpll vector<pll>
#define fastio                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define cy                                                                     \\
  cout << "YES"                                                                \\
       << "\\n";
#define cn                                                                     \\
  cout << "NO"                                                                 \\
       << "\\n";
#define nl cout << "\\n";
#define chk cout << "*\\n";
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;

/*-----------------------------Modular Arithmetic---------------------*/
inline ll add(ll x, ll y, ll mod) {
  x += y;
  if (x >= mod)
    return x - mod;
  return x;
}
inline ll sub(ll x, ll y, ll mod) {
  x -= y;
  if (x < 0)
    return x + mod;
  return x;
}
inline ll mul(ll x, ll y, ll mod) { return (x * 1ll * y) % mod; }
inline ll power(ll x, ll y, ll mod) {
  ll ans = 1;
  while (y) {
    if (y & 1)
      ans = mul(ans, x, mod);
    x = mul(x, x, mod);
    y >>= 1;
  }
  return ans;
}
inline ll inv(ll x, ll mod) { return power(x, mod - 2, mod); }

/*------------------------ Important Functions ----------------------------*/

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

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

/*------------------------ Trouble begins here ----------------------------*/

const ll mod = 1e9 + 7, M2 = 998244353;
const ll N = 1e5 + 100;

ll factmod(ll n, ll p) {
  ll res = 1;
  while (n > 1) {
    res = (res * ((n / p) % 2 ? p - 1 : 1)) % p;
    for (ll i = 2; i <= n % p; ++i)
      res = (res * i) % p;
    n /= p;
  }
  return res % p;
}

ll largestPower(ll n, ll p) {
  ll x = 0;
  while (n) {
    n /= p;
    x += n;
  }
  return x;
}

ll modFact(ll n, ll p) {
  if (n >= p)
    return 0;
  ll res = 1;
  bool isPrime[n + 1];
  memset(isPrime, 1, sizeof(isPrime));
  for (ll i = 2; i * i <= n; i++) {
    if (isPrime[i]) {
      for (ll j = 2 * i; j <= n; j += i)
        isPrime[j] = 0;
    }
  }
  for (ll i = 2; i <= n; i++) {
    if (isPrime[i]) {
      ll k = largestPower(n, i);
      res = (res * power(i, k, p)) % p;
    }
  }
  return res;
}

ll fastpower(ll n, ll p, ll m) {
  if (p == 0)
    return 1;

  ll t = fastpower(n, p / 2, m);
  ll ans = (t * t) % m;

  if (p % 2 != 0) {
    ans = (ans * n % m) % m;
  }
  return ans;
}

ll countWays(vll arr, ll m, ll N) {
  ll count[N + 1];
  memset(count, 0, sizeof(count));

  // base case
  count[0] = 1;

  // count ways for all values up
  // to 'N' and store the result
  for (ll i = 1; i <= N; i++)
    for (ll j = 0; j < m; j++)

      // if i >= arr[j] then
      // accumulate count for value 'i' as
      // ways to form value 'i-arr[j]'
      if (i >= arr[j]) {
        count[i] += count[i - arr[j]];
        count[i] %= mod;
      }

  // required number of ways
  return count[N];
}

ll count(ll n) {
  // table[i] will store count
  // of solutions for value i.
  if (n == 3)
    return 1;
  else if (n == 6)
    return 2;
  else if (n == 9)
    return 4;

  ll table[n + 1], i;

  // Initialize all table
  // values as 0
  for (i = 0; i < n + 1; i++)
    table[i] = 0;

  // Base case (If given value
  // is 0, 1, 2, or 4)
  table[0] = 0;
  table[3] = 1;
  table[6] = 2;
  table[9] = 4;

  for (i = 8; i <= n; i = i + 2) {

    table[i] = table[i - 2] + table[i - 4] + table[i - 6];
  }

  return table[n];
}

void solve() {
  ll n, i;
  cin >> n;

  vll arr;
  for (i = 3; i <= n; i++)
    arr.push_back(i);
  ll x = arr.size();
  cout << countWays(arr, x, n) % mod;

  nl return;
}

int main() {

  fastio

      ll tc = 1;
  // cin>>tc;
  while (tc--) {

    // cout<<"ch\\n";
    solve();
  }

  return 0;
}


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

// Template START
#define endl "\\n"
#define async                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define int long long int
#define all(y) y.begin(), y.end()
#define present(x, y) (x.find(y) != x.end())
const int mod = (int)1e9 + 7;
template <class T> auto matrix(int r, int c, T v) {
  return vector<vector<T>>(r, vector<T>(c, v));
}
template <class T> auto matrix(int o1, int o2, int o3, T v) {
  return vector<vector<vector<T>>>(o1, vector<vector<T>>(o2, vector<T>(o3, v)));
}
#define v vector
// Template END

int power(int x, int n) {
  if (n == 0)
    return 1;
  else if (n & 1)
    return (x * power((x * x) % mod, n / 2)) % mod;
  return power((x * x) % mod, n / 2) % mod;
}

signed main() {
  int s;
  cin >> s;
  assert(s <= 2000);
  v<int> dp(s + 1, 0);
  dp[0] = 1;
  dp[3] = 1;
  for (int i = 4; i <= s; i++) {
    for (int j = 3; (i - j) >= 0; j++) {
      (dp[i] += dp[i - j]) %= mod;
    }
  }
  cout << dp[s];
  return 0;
}

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

// Template START
#define endl "\\n"
#define async                                                                  \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);
#define int long long int
#define all(y) y.begin(), y.end()
#define present(x, y) (x.find(y) != x.end())
const int mod = (int)1e9 + 7;
template <class T> auto matrix(int r, int c, T v) {
  return vector<vector<T>>(r, vector<T>(c, v));
}
template <class T> auto matrix(int o1, int o2, int o3, T v) {
  return vector<vector<vector<T>>>(o1, vector<vector<T>>(o2, vector<T>(o3, v)));
}
#define v vector
// Template END

int power(int x, int n) {
  if (n == 0)
    return 1;
  else if (n & 1)
    return (x * power((x * x) % mod, n / 2)) % mod;
  return power((x * x) % mod, n / 2) % mod;
}

signed main() {
  int s;
  cin >> s;
  // assert( s <= 2000 ) ;
  v<int> dp(s + 1, 0);
  dp[0] = 1;
  // dp[3] = 1 ;
  for (int i = 3; i <= s; i++) {
    for (int j = 3; (i - j) >= 0; j++) {
      (dp[i] += dp[i - j]) %= mod;
    }
  }
  cout << dp[s];
  return 0;
}


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

int main() {
  int s;
  cin >> s;
  vector<int> sum(s, 0);
  vector<int> dp(s, 0);
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  sum[3] = 1;
  sum[4] = 2;
  sum[5] = 3;
  for (int i = 6; i < s + 1; i++) {
    dp[i] = 1 + sum[i - 3];

    if (dp[i] >= mod) {
      dp[i] = dp[i] % mod;
    }
    sum[i] = sum[i - 1] + dp[i];
    if (sum[i] >= mod) {
      sum[i] = sum[i] % mod;
    }
  }
  cout << dp[s] << endl;
}

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

int main() {
  int s;
  cin >> s;
  vector<int> sum(s + 1, 0);
  vector<int> dp(s + 1, 0);
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  sum[3] = 1;
  sum[4] = 2;
  sum[5] = 3;
  if (s >= 6) {
    for (int i = 6; i < s + 1; i++) {
      dp[i] = 1 + sum[i - 3];

      if (dp[i] >= mod) {
        dp[i] = dp[i] % mod;
      }
      sum[i] = sum[i - 1] + dp[i];
      if (sum[i] >= mod) {
        sum[i] = sum[i] % mod;
      }
    }
  }
  cout << dp[s] << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define INF (1LL << 50)
#define MOD 1000000007

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define INF (1LL << 50)
#define MOD 1000000007

int main() {
  int S;
  cin >> S;
  if (S < 3) {
    cout << 0 << endl;
    return 0;
  }
  vector<ll> ans(S + 1);
  // ans[i] = ans[i-3] + ans[i-4] + ... + ans[0]
  // ans[i-1] =          ans[i-4] + ... + ans[0]
  // ans[i] = ans[i-1] + ans[i-3]
  ans[3] = 1;
  for (int i = 4; i <= S; i++) {
    ans[i] = ans[i - 1] + ans[i - 3];
    ans[i] %= MOD;
  }
  cout << ans[S] << endl;
  return 0;
}


#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define mk make_pair
#define pk push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
int n, f[2005][2005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  int ans = 0;
  f[0][0] = 1;
  for (int i = 1; i <= n / 3; ++i) {
    for (int j = i * 3; j <= n; ++j)
      for (int k = 3; k <= j; ++k)
        (f[j][i] += f[j - k][i - 1]) %= mod;
    (ans += f[n][i]) %= mod;
  }
  cout << ans << endl;
  return 0;
}

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <vector>
#define mk make_pair
#define pk push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pi;
const int mod = 1e9 + 7;
int n, f[2005], g[2005];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  int ans = 0;
  f[0] = 1;
  for (int i = 1; i <= n; ++i) {
    memcpy(g, f, sizeof f);
    for (int j = 3; j <= n; ++j)
      if (i >= j)
        (f[i] += g[i - j]) %= mod;
  }
  cout << f[n] << endl;
  return 0;
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#define M 1010
#define N 1000000
#define D double
#define LL long long
#pragma GCC optimize(2)
using namespace std;
LL n, a[N], sum = 0, mod = 1e9 + 7;
;
void zbc(LL s, LL x) {
  for (int i = 3; i <= s; i++)
    if (i < n) {
      s -= i;
      a[x] = i;
      if (s == 0)
        sum = (sum + 1) % mod;
      else
        zbc(s, x + 1);
      s += i;
    }
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  if (n < 3) {
    cout << 0;
    return 0;
  }
  if (n == 3) {
    cout << 1;
    return 0;
  }
  a[0] = 1;
  zbc(n, 1);
  cout << sum % mod + 1;
  return 0;
}
/*
 */

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#define M 1010
#define N 1000000
#define D double
#define LL long long
using namespace std;
LL n, dp[N], mod = 1e9 + 7;
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  dp[3] = 1;
  for (int i = 4; i <= n; i++)
    dp[i] = (dp[i - 1] + dp[i - 3]) % mod;
  cout << dp[n];
  return 0;
}
/*
 */


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

int main() {
  int s;
  cin >> s;
  vector<in> a(s + 1);
  rep(i, 3) a.at(i) = 0;
  for (int i = 3; i <= s; i++) {
    a.at(i) = 1;
    for (int j = 3; j <= s; j++) {
      if (i - j < 3)
        break;
      a.at(i) += a.at(i - j);
      a.at(i) = a.at(i) % MOD;
    }
  }
  cout << a.at(s) << endl;
}

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

int main() {
  int s;
  cin >> s;
  vector<in> a(s + 1, 0);

  for (int i = 3; i <= s; i++) {
    a.at(i) = 1;
    for (int j = 3; j < i; j++) {
      if (i - j < 3)
        break;
      a.at(i) += a.at(i - j);
      a.at(i) = a.at(i) % MOD;
    }
  }
  cout << a.at(s) << endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ACC                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mod 1000000007
#define MAXN 10000001
// string alpha="abcdefghijklmnopqrstuvwxyz";
// int dx[]={1,-1,0,0};
// int dy[]={0,0,1,-1};
// int dx8[]={1,-1,0,0,1,1,-1,-1};
// int dy8[]={0,0,1,-1,1,-1,1,-1};
/*int spf[MAXN];
void sieve()
{
        int i,j;
        for(i=0;i<MAXN;i++)
        spf[i]=i;
        for(i=4;i<MAXN;i+=2)
        spf[i]=2;
        for(i=3;i*i<MAXN;i++)
        {
                if(spf[i]==i)
                {
                        for(j=i*i;j<MAXN;j+=i)
                        {
                                if(spf[j]==j)spf[j]=i;
                        }
                }
        }
}*/
/*bool isvowel(char c)
{
    switch(c)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':return true;
        default : return false;
    }
}*/
/*bool isValid(int x,int y,int n,int m)
{
    if(x<0||x>n-1||y<0||y>m-1)return false;
    return true;
}*/
/*
bool comp(pair<int,int> x,pair<int,int> y)
{
    if(y.second==x.second)
        return y.first<x.first;
    return y.second<x.second;
}*/
int32_t main() {
  ACC int T;
  T = 1;
  // cin>>T;
  while (T--) {
    int s, j, i;
    cin >> s;
    int dp[s + 1];
    dp[0] = 1;
    dp[1] = 0;
    dp[2] = 0;
    dp[3] = 1;
    for (i = 4; i <= s; i++) {
      dp[i] = 0;
      int x = 0;
      for (j = 3; j <= i; j++) {
        if (i - j >= 0)
          x = (x % mod + dp[i - j] % mod) % mod;
      }
      dp[i] = x % mod;
    }
    cout << dp[s] << "\\n";
  }
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ACC                                                                    \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mod 1000000007
#define MAXN 10000001
// string alpha="abcdefghijklmnopqrstuvwxyz";
// int dx[]={1,-1,0,0};
// int dy[]={0,0,1,-1};
// int dx8[]={1,-1,0,0,1,1,-1,-1};
// int dy8[]={0,0,1,-1,1,-1,1,-1};
/*int spf[MAXN];
void sieve()
{
        int i,j;
        for(i=0;i<MAXN;i++)
        spf[i]=i;
        for(i=4;i<MAXN;i+=2)
        spf[i]=2;
        for(i=3;i*i<MAXN;i++)
        {
                if(spf[i]==i)
                {
                        for(j=i*i;j<MAXN;j+=i)
                        {
                                if(spf[j]==j)spf[j]=i;
                        }
                }
        }
}*/
/*bool isvowel(char c)
{
    switch(c)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':return true;
        default : return false;
    }
}*/
/*bool isValid(int x,int y,int n,int m)
{
    if(x<0||x>n-1||y<0||y>m-1)return false;
    return true;
}*/
/*
bool comp(pair<int,int> x,pair<int,int> y)
{
    if(y.second==x.second)
        return y.first<x.first;
    return y.second<x.second;
}*/
int32_t main() {
  ACC int T;
  T = 1;
  // cin>>T;
  while (T--) {
    int s, j, i;
    cin >> s;
    int dp[s + 100];
    dp[0] = 1;
    dp[1] = 0;
    dp[2] = 0;
    dp[3] = 1;
    for (i = 4; i <= s; i++) {
      dp[i] = 0;
      int x = 0;
      for (j = 3; j <= i; j++) {
        if (i - j < 0)
          continue;
        x = (x % mod + dp[i - j] % mod) % mod;
      }
      dp[i] = x % mod;
    }
    cout << dp[s] << "\\n";
  }
  return 0;
}


// ctrl+shift+b
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i, m, n) for (ll i = m; i < (ll)(n); i++)
#define rrep(i, n, m) for (ll i = n; i >= (ll)(m); i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
  // A[n] = A[n - 1] + A[n - 3]
  ll n;
  cin >> n;
  vector<ll> A(n + 1, 0);
  A.at(3) = 1;
  rep2(i, 4, n + 1) { A.at(i) = (A.at(i - 1) + A.at(i - 3)) % MOD; }
  cout << A.at(n) << endl;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
  return 0;
}

#include <bits/stdc++.h>

typedef long long ll;

using namespace std;

const ll N = 100001;

int dp[667][2010];

const ll mod = 1000000000 + 7;

int main() {

  int S;
  cin >> S;

  int p = S / 3;

  for (int i = 3; i <= S; ++i) {
    dp[1][i] = 1;
  }
  /*
      for(int i=0;i<=p;i++){
          for(int j=0;j<=S;j++){
              cout<<dp[i][j]<<" ";
          }
          cout<<endl;
      }
      */

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

    cout<<"========="<<endl;
     for(int i=0;i<=p;i++){
    for(int j=0;j<=S;j++){
        cout<<dp[i][j]<<" ";
    }
    cout<<endl;

}
*/
  }

  ll ans = 0;

  for (int i = 1; i <= p; i++) {

    ans = (ans + dp[i][S]) % mod;
  }

  cout << ans << endl;
}


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

#define fastIO                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const ll MOD = 1E9 + 7, INF = 2E18 + 5;
const double PI = 2 * acos(0.0);
const long double EPS = 1.0E-14;

ll dp[2000][2000];
ll n;

ll check(ll pos, ll val) {
  if (val == 0)
    return 1;
  if (dp[pos][val] != -1)
    return dp[pos][val];

  ll ans = 0;
  for (int i = 3; i <= 2000; i++) {
    if (val - i >= 0) {
      ans += check(pos + 1, val - i);
      ans %= MOD;
    }
  }
  return dp[pos][val] = ans;
}

int main() {
  ll ans = 0;
  cin >> n;

  memset(dp, -1, sizeof dp);

  for (int i = 3; i <= 2000; i++) {
    if (n - i >= 0) {
      ans += check(0, n - i);
      ans %= MOD;
    }
  }
  cout << ans;

  return 0;
}

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

#define fastIO                                                                 \\
  ios_base::sync_with_stdio(false);                                            \\
  cin.tie(NULL);                                                               \\
  cout.tie(NULL);
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const ll MOD = 1E9 + 7, INF = 2E18 + 5;
const double PI = 2 * acos(0.0);
const long double EPS = 1.0E-14;

ll dp[2000];
ll n;

ll check(ll val) {
  if (val == 0)
    return 1;
  if (dp[val] != -1)
    return dp[val];

  ll ans = 0;
  for (int i = 3; i <= 2000; i++) {
    if (val - i >= 0) {
      ans += check(val - i);
      ans %= MOD;
    }
  }
  return dp[val] = ans;
}

int main() {
  ll ans = 0;
  cin >> n;

  memset(dp, -1, sizeof dp);

  for (int i = 3; i <= 2000; i++) {
    if (n - i >= 0) {
      ans += check(n - i);
      ans %= MOD;
    }
  }
  cout << ans;

  return 0;
}


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

#pragma region // {{{

#define all(x) std::begin(x), std::end(x)
#define rall(x) std::rbegin(x), std::rend(x)
#define rep(i, begin, end)                                                     \\
  for (int64_t i{begin}, i##_end{end}; i < i##_end; ++i)
#define repc(i, begin, last)                                                   \\
  for (int64_t i{begin}, i##_last{last}; i <= i##_last; ++i)
#define repr(i, begin, last)                                                   \\
  for (int64_t i{begin}, i##_last{last}; i >= i##_last; --i)
#define let const auto
using i64 = std::int64_t;
using u64 = std::uint64_t;

constexpr int32_t INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;

void ioSetup() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(11);
  std::cerr << std::fixed << std::setprecision(11);
  std::clog << std::fixed << std::setprecision(11);
}

template <class T> std::istream &operator,(std::istream &is, T &rhs) {
  return is >> rhs;
}

#define var(type, ...)                                                         \\
  type __VA_ARGS__;                                                            \\
  std::cin >> __VA_ARGS__

inline void println() { std::cout << '\\n'; }
template <class Head, class... Tail>
inline void println(Head &&head, Tail &&...tail) {
  std::cout << head << " " + (!sizeof...(tail));
  println(std::forward<Tail>(tail)...);
}

template <class T, class U> inline bool chmin(T &a, const U &b) {
  return b < a && (a = b, true);
}

template <class T, class U> inline bool chmax(T &a, const U &b) {
  return b > a && (a = b, true);
}

#pragma endregion // }}}

constexpr int MOD = int(1e9) + 7;
// constexpr int MOD = 998244353;

i64 S;

i64 dp(int i, int sum) {
  if (sum == S)
    return 1;
  if (sum > S)
    return 0;

  i64 ret = 0;
  repc(a, 3, S - sum) { ret += dp(i + 1, int(sum + a)); }

  return ret;
}

signed main() {
  ioSetup();

  cin >> S;
  /* println(dp(0, 0)); */

  vector<vector<i64>> dp(S, vector<i64>(S + 5, 0));
  rep(i, 0, S) { dp[i][S] = 1; }

  repr(i, S / 3, 0) {
    repr(j, S - 1, 0) { (dp[i + 1][j] += dp[i + 1][j + 1]) %= MOD; }
    rep(j, 0, S) { dp[i][j] = dp[i + 1][j + 3]; }
  }
  println(dp[0][0]);

  return 0;
}

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

#pragma region // {{{

#define all(x) std::begin(x), std::end(x)
#define rall(x) std::rbegin(x), std::rend(x)
#define rep(i, begin, end)                                                     \\
  for (int64_t i{begin}, i##_end{end}; i < i##_end; ++i)
#define repc(i, begin, last)                                                   \\
  for (int64_t i{begin}, i##_last{last}; i <= i##_last; ++i)
#define repr(i, begin, last)                                                   \\
  for (int64_t i{begin}, i##_last{last}; i >= i##_last; --i)
#define let const auto
using i64 = std::int64_t;
using u64 = std::uint64_t;

constexpr int32_t INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;

void ioSetup() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(11);
  std::cerr << std::fixed << std::setprecision(11);
  std::clog << std::fixed << std::setprecision(11);
}

template <class T> std::istream &operator,(std::istream &is, T &rhs) {
  return is >> rhs;
}

#define var(type, ...)                                                         \\
  type __VA_ARGS__;                                                            \\
  std::cin >> __VA_ARGS__

inline void println() { std::cout << '\\n'; }
template <class Head, class... Tail>
inline void println(Head &&head, Tail &&...tail) {
  std::cout << head << " " + (!sizeof...(tail));
  println(std::forward<Tail>(tail)...);
}

template <class T, class U> inline bool chmin(T &a, const U &b) {
  return b < a && (a = b, true);
}

template <class T, class U> inline bool chmax(T &a, const U &b) {
  return b > a && (a = b, true);
}

#pragma endregion // }}}

constexpr int MOD = int(1e9) + 7;
// constexpr int MOD = 998244353;

i64 S;

i64 dp(int i, int sum) {
  if (sum == S)
    return 1;
  if (sum > S)
    return 0;

  i64 ret = 0;
  repc(a, 3, S - sum) { ret += dp(i + 1, int(sum + a)); }

  return ret;
}

signed main() {
  ioSetup();

  cin >> S;
  if (S == 1) {
    println(0);
    return 0;
  }

  vector<vector<i64>> dp(S, vector<i64>(S + 5, 0));
  rep(i, 0, S) { dp[i][S] = 1; }

  repr(i, S / 3, 0) {
    repr(j, S - 1, 0) { (dp[i + 1][j] += dp[i + 1][j + 1]) %= MOD; }
    rep(j, 0, S) { dp[i][j] = dp[i + 1][j + 3]; }
  }
  println(dp[0][0]);

  return 0;
}


#include <bits/stdc++.h>
#include <iostream>

using namespace std;

#define ll long long int
#define ld long double
#define MAX 100005
#define MOD 1000000007
#define fast                                                                   \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define pi 3.14159265358979323846
#define Q                                                                      \\
  ll _;                                                                        \\
  cin >> _;                                                                    \\
  while (_--)
#define endl "\\n"
#define flush fflush(stdout);

int main() {

  fast

      ll i,
      j, n;
  cin >> n;
  ll dp[n + 1];
  for (i = 0; i <= n; i++) {
    dp[i] = 0;
  }
  dp[0] = 1;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;

  for (i = 6; i <= n; i++) {
    for (j = 0; j <= i - 3; j++) {
      dp[i] = (dp[j] % MOD) + (dp[i] % MOD);
      dp[i] = dp[i] % MOD;
    }
  }
  ll ans = dp[n] % MOD;
  cout << ans % MOD << endl;
}

//    cout << fixed << setprecision(12);

#include <bits/stdc++.h>
#include <iostream>

using namespace std;

#define ll long long int
#define ld long double
#define MAX 100005
#define MOD 1000000007
#define fast                                                                   \\
  ios::sync_with_stdio(0);                                                     \\
  cin.tie(0);                                                                  \\
  cout.tie(0);
#define pi 3.14159265358979323846
#define Q                                                                      \\
  ll _;                                                                        \\
  cin >> _;                                                                    \\
  while (_--)
#define endl "\\n"
#define flush fflush(stdout);

int main() {

  fast

      ll i,
      j, n;
  cin >> n;
  ll dp[2001];
  for (i = 0; i <= n; i++) {
    dp[i] = 0;
  }
  dp[0] = 1;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;

  for (i = 6; i <= n; i++) {
    for (j = 0; j <= i - 3; j++) {
      dp[i] = (dp[j] % MOD) + (dp[i] % MOD);
      dp[i] = dp[i] % MOD;
    }
  }
  ll ans = dp[n] % MOD;
  cout << ans % MOD << endl;
}

//    cout << fixed << setprecision(12);


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

struct listnode {
  int val;
  listnode *next;
};
vector<int> func(vector<int> a, vector<int> l, int sum) {
  vector<int> k, val;
  for (int i = 0; i < l.size(); i++)
    if (l[i] == 0) {
      k.push_back(i);
      val.push_back(a[i]);
    }
  if (sum < 0)
    return a;
  else {
    sort(val.rbegin(), val.rend());
    for (int i = 0; i < k.size(); i++)
      a[k[i]] = val[i];
  }
  return a;
}

int32_t main() {
  int m = 1000000007;

  int n;
  cin >> n;
  int dp[2001];
  dp[0] = 1;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  dp[6] = 2;
  dp[7] = 3;
  for (int i = 8; i <= n + 1; i++)
    dp[i] = (dp[i - 3] + dp[i - 1]) % m;
  cout << dp[n] % m << endl;
  return 0;
}

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

struct listnode {
  int val;
  listnode *next;
};
vector<int> func(vector<int> a, vector<int> l, int sum) {
  vector<int> k, val;
  for (int i = 0; i < l.size(); i++)
    if (l[i] == 0) {
      k.push_back(i);
      val.push_back(a[i]);
    }
  if (sum < 0)
    return a;
  else {
    sort(val.rbegin(), val.rend());
    for (int i = 0; i < k.size(); i++)
      a[k[i]] = val[i];
  }
  return a;
}

int32_t main() {
  int m = 1000000007;

  int n;
  cin >> n;
  int dp[2001];
  dp[0] = 1;
  dp[1] = 0;
  dp[2] = 0;
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  dp[6] = 2;
  dp[7] = 3;
  for (int i = 8; i < n + 1; i++)
    dp[i] = (dp[i - 3] + dp[i - 1]) % m;
  cout << dp[n] % m << endl;
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 13;
const int mod = 1e9 + 7;
ll c[2013][2013];
int main() {
  int s;
  scanf("%d", &s);
  c[1][0] = 1ll;
  c[0][0] = 0ll;
  for (int i = 1; i <= 5003; i++) {
    for (int j = 0; j <= i; j++) {
      if (i == j) {
        c[i][j] = 1;
        continue;
      }
      if (i && j)
        c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
      if (j == 0)
        c[i][j] = 1ll;
    }
  }
  if (s <= 3) {
    printf("%d", 0);
    return 0;
  }
  int mx = s / 2;
  ll ans = 0;
  for (int i = 1; i <= mx; i++) {
    if (s - i * 2 == 0)
      continue;
    ans += c[s - i * 2 - 1][i - 1];
    ans %= mod;
  }
  printf("%lld", ans);
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 13;
const int mod = 1e9 + 7;
ll c[2013][2013];
int main() {
  int s;
  scanf("%d", &s);
  c[1][0] = 1ll;
  c[0][0] = 0ll;
  for (int i = 1; i <= 2003; i++) {
    for (int j = 0; j <= 2003; j++) {
      c[i][j] = 0;
    }
  }
  for (int i = 1; i <= 2003; i++) {
    for (int j = 0; j <= i; j++) {
      if (i == j) {
        c[i][j] = 1;
        continue;
      }
      if (i && j)
        c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
      if (j == 0)
        c[i][j] = 1ll;
    }
  }
  if (s <= 3) {
    if (s < 3)
      printf("%d", 0);
    else if (s == 3)
      printf("1");
    return 0;
  }
  int mx = s / 2;
  ll ans = 0;
  for (int i = 1; i <= mx; i++) {
    if (s - i * 2 == 0)
      continue;
    ans += c[s - i * 2 - 1][i - 1];
    ans %= mod;
  }
  printf("%lld", ans);
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
// #define _GLIBCXX_DEBUG

const int mod = 1000000007;

int a(vector<int> &dp, int S) {
  if (S <= 2)
    return 0;
  if (S <= 5)
    return 1;
  if (dp[S] >= 0)
    return dp[S];
  int ans = 0;
  for (int i = 3; i < S; i++) {
    ans += a(dp, S - i);
    ans %= mod;
  }
  ans++;
  dp[S] = ans;
  return ans;
}

signed main() {
  int S;
  cin >> S;
  vector<int> dp(S + 1, -1);

  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;

  cout << a(dp, S) << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
// #define _GLIBCXX_DEBUG

const int mod = 1000000007;

int a(vector<int> &dp, int S) {
  if (S <= 2)
    return 0;
  if (S <= 5)
    return 1;
  if (dp[S] >= 0)
    return dp[S];
  int ans = 0;
  for (int i = 3; i < S; i++) {
    ans += a(dp, S - i);
    ans %= mod;
  }
  ans++;
  dp[S] = ans;
  return ans;
}

signed main() {
  int S;
  cin >> S;
  vector<int> dp(S + 1, -1);

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

  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;

  cout << a(dp, S) << endl;
}


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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

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

int main() {
  int s;
  cin >> s;
  if (s < 3) {
    cout << 0 << endl;
    return 0;
  }
  vector<mint> dp(s + 1);
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  for (int i = 6; i <= s; i++) {
    dp[i] = dp[i - 1] + dp[i - 3];
  }
  cout << dp[s] << endl;
  return 0;
}
/*
g++ -std=c++17 -Wall -Wextra -g -O0 -fsanitize=undefined,address main.cpp && oj
t
*/

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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a) {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a) {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

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

int main() {
  int s;
  cin >> s;
  if (s < 3) {
    cout << 0 << endl;
    return 0;
  } else if (s < 6) {
    cout << 1 << endl;
    return 0;
  }
  vector<mint> dp(s + 3);
  dp[3] = 1;
  dp[4] = 1;
  dp[5] = 1;
  for (int i = 6; i <= s; i++) {
    dp[i] = dp[i - 1] + dp[i - 3];
  }
  cout << dp[s] << endl;
  return 0;
}
/*
g++ -std=c++17 -Wall -Wextra -g -O0 -fsanitize=undefined,address main.cpp && oj
t
*/


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 10;
const int mod = 1e9 + 7;
ll c[2010][2010];
void init(int n) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i; j++) {
      if (!j)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0), cin.tie(0);
  int s;
  cin >> s;
  init(2005);
  ll ans = 0;
  for (int i = 1; i * 2 <= s; i++) {
    ans = (ans + c[s - 2 * i - 1][i - 1]) % mod;
  }
  cout << ans << endl;
  return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 1e5 + 10;
const int mod = 1e9 + 7;
ll c[2010][2010];
void init(int n) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i; j++) {
      if (!j)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cout.tie(0), cin.tie(0);
  int s;
  cin >> s;
  init(2005);
  ll ans = 0;
  for (int i = 1; i * 2 <= s - 1; i++) {
    ans = (ans + c[s - 2 * i - 1][i - 1]) % mod;
  }
  cout << ans << endl;
  return 0;
}


#pragma GCC optimize("O3")
#include <algorithm>
#include <bits/stdc++.h>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#define forr(i, a, b) for (int i = a; i <= b; i++)
#define F first
#define S second
#define input                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);

const double PI = acos(-1.0);
using namespace std;
// typedef pair<double,double>pdd;
typedef long long ll;
typedef pair<ll, ll> pii;
// typedef complex<double> point;
// int x[8]={1,0,0,-1,-1,-1,1,1};
// int y[8]={0,1,-1,0,-1,1,-1,1};
// char rv[4]={'D','R','L','U'};
const double EPS = 1e-9;
const int N = 1000000 + 9;
ll n, ans, mod = 1e9 + 7, mem[2009][2009];

ll dp(int i, int sum) {
  if (sum == n)
    return 1;
  ll &ret = mem[i][sum];
  if (~ret)
    return ret;

  ret = 0;
  forr(j, 3, n) {
    if (sum + j <= n)
      ret += dp(i + 1, sum + j), ret %= mod;
  }
  return ret;
}
int main() {
  // freopen("calc.in","r",stdin);
  // freopen("calc.out","w",stdout);
  //__builtin_popcount()
  input cin >> n;
  memset(mem, -1, sizeof mem);
  cout << dp(1, 0) << endl;

  return 0;
}

#pragma GCC optimize("O3")
#include <algorithm>
#include <bits/stdc++.h>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#define forr(i, a, b) for (int i = a; i <= b; i++)
#define F first
#define S second
#define input                                                                  \\
  ios_base::sync_with_stdio(0);                                                \\
  cin.tie(0);

const double PI = acos(-1.0);
using namespace std;
// typedef pair<double,double>pdd;
typedef long long ll;
typedef pair<ll, ll> pii;
// typedef complex<double> point;
// int x[8]={1,0,0,-1,-1,-1,1,1};
// int y[8]={0,1,-1,0,-1,1,-1,1};
// char rv[4]={'D','R','L','U'};
const double EPS = 1e-9;
const int N = 1000000 + 9;
ll n, ans, mod = 1e9 + 7, mem[2009];

ll dp(int sum) {
  if (!sum)
    return 1;
  ll &ret = mem[sum];
  if (~ret)
    return ret;

  ret = 0;
  forr(j, 3, n) {
    if (j <= sum)
      ret += dp(sum - j), ret %= mod;
  }
  return ret;
}
int main() {
  // freopen("calc.in","r",stdin);
  // freopen("calc.out","w",stdout);
  //__builtin_popcount()
  input cin >> n;
  memset(mem, -1, sizeof mem);
  cout << dp(n) << endl;

  return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define ull unsigned long long
#define mp make_pair
#define F first
#define S second
#define mod 1000000007

ll n;
ll countWays() {
  ll DP[n + 1];
  vector<ll> dp(n + 1, 0);

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

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

  return dp[n] % mod;
}

int main() {
  cin >> n;
  cout << countWays() << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define pii pair<int, int>
#define pll pair<long long, long long>
#define ull unsigned long long
#define mp make_pair
#define F first
#define S second
#define mod 1000000007
ll n;
vector<ll> dp(2005, 0);
ll countWays() {

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

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

  return dp[n] % mod;
}

int main() {
  cin >> n;
  cout << countWays() << endl;
}


#include <bits/stdc++.h>
using namespace std;
long long s, sm;
long long dp[2001][2001];
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> s;
  for (int i = 3; i <= s; i++)
    dp[1][i] = 1;
  for (int i = 2; i <= s / 3; i++) {
    for (int j = 3 * i; j <= s; j++) {
      for (int i1 = 3; i1 <= j; i1++) {
        dp[i][j] = dp[i][j] + dp[i - 1][j - i1];
        dp[i][j] %= (long long)(1e9 + 7);
      }
    }
  }
  for (int i = 1; i <= s / 3; i++) {
    sm += dp[i][s];
    sm %= (long long)(1e9 + 7);
  }
  cout << sm;
}

#include <bits/stdc++.h>
using namespace std;
long long s, sm;
long long dp[2001][2001];
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cin >> s;
  for (int i = 3; i <= s; i++)
    dp[1][i] = 1;
  for (int i = 2; i <= s / 3; i++) {
    for (int j = 3 * i; j <= s; j++) {
      for (int i1 = 3; i1 <= j; i1++) {
        dp[i][j] = dp[i][j] + dp[i - 1][j - i1];
        if (dp[i][j] >= (long long)(1e9 + 7)) {
          dp[i][j] -= (long long)(1e9 + 7);
        }
      }
    }
  }
  for (int i = 1; i <= s / 3; i++) {
    sm += dp[i][s];
    if (sm >= (long long)(1e9 + 7)) {
      sm -= (long long)(1e9 + 7);
    }
  }
  cout << sm;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int, int>
#define PI 3.141592653589793
const int INF = 1001001001;
const ll MX = 1e18;
const int mod = 1000000007;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

uintmax_t combination(unsigned int n, unsigned int r) {
  if (r * 2 > n)
    r = n - r;
  uintmax_t dividend = 1;
  uintmax_t divisor = 1;
  for (unsigned int i = 1; i <= r; ++i) {
    dividend *= (n - i + 1);
    divisor *= i;
  }
  return dividend / divisor;
}

int main() {
  int n;
  cin >> n;
  if (n <= 2) {
    cout << 0 << endl;
    return 0;
  }
  int m = n / 3;
  int a = n % 3;
  ll ans = 0;
  rep(i, m) {
    int mi = m - i;

    ans += combination(a + mi - 1, mi - 1);
    ans %= mod;
    a += 3;
  }
  cout << ans << endl;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define P pair<int, int>
#define PI 3.141592653589793
const int INF = 1001001001;
const ll MX = 1e18;
const int mod = 1000000007;
template <class T> inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

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