// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

/* typedef */

typedef long long ll;

typedef pair<int, int> pii;

/* constant */

const int INF = 1 << 30;

const ll LINF = 1LL << 61;

const int NIL = -1;

const int MAX = 10000;

const int mod = 1000000007;

const double pi = 3.141592653589;

/* struct */

struct mint {

        ll x;

        mint(ll x = 0):x((x % mod + mod) % mod) {}

        mint operator-() const { return mint(-x); }

        mint& operator+=(const mint a) {

            if ((x += a.x) >= mod) x -= mod;

            return *this;

        }

        mint& operator-=(const mint a) {

            if ((x += mod - a.x) >= mod) x -= mod;

            return *this;

        }

        mint& operator*=(const mint a) {

            (x *= a.x) %= mod;

            return *this;

        }

        mint operator+(const mint a) const {

            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, const mint& a) { return is >> a.x;}

ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {

        // vector size : n + 1

        vector<mint> fact, ifact;

        // precaliculation O(n)

        combination(int n):fact(n+1), ifact(n+1) {

            assert(n < mod);

            // 0! = 1;

            fact[0] = 1;

            // 1! = 0! * 1 ... n! = (n-1)! * n

            for (int i = 1; i <= n; i++) fact[i] = fact[i-1] * i;

            // 1/n! = n!^(-1)

            ifact[n] = fact[n].inv();

            // (n-1)!^(-1) = n!^(-1) * n ... 0!^(-1) = 1!^(-1) * 1

            for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i] * i;

        }

        // combination O(1)

        // nCk = n! / (k! * (n-k)!)

        //     = n! * k!^(-1) * (n-k)!^(-1)

        mint operator()(int n, int k) {

            if (k < 0 || k > n) return 0;

            return fact[n] * ifact[k] * ifact[n-k];

        }

};

/* global variables */

/* function */

/* main */

int main(){

    int S;

    cin >> S;

    mint ans = 0;

    combination c = combination(10000);

    for (int n = S / 3, r = S % 3; n >= 0; n--, r += 3) {

        ans += c(n + r - 1 , r);

    }

    cout << ans << '\n';

}


// Faster C++ solution for the same problem (measured speedup: 1.2985169967352368x):
#include <bits/stdc++.h>

using namespace std;

/* typedef */

typedef long long ll;

typedef pair<int, int> pii;

/* constant */

const int INF = 1 << 30;

const ll LINF = 1LL << 61;

const int NIL = -1;

const int MAX = 10000;

const int mod = 1000000007;

const double pi = 3.141592653589;

/* struct */

struct mint {

        ll x;

        mint(ll x = 0):x((x % mod + mod) % mod) {}

        mint operator-() const { return mint(-x); }

        mint& operator+=(const mint a) {

            if ((x += a.x) >= mod) x -= mod;

            return *this;

        }

        mint& operator-=(const mint a) {

            if ((x += mod - a.x) >= mod) x -= mod;

            return *this;

        }

        mint& operator*=(const mint a) {

            (x *= a.x) %= mod;

            return *this;

        }

        mint operator+(const mint a) const {

            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, const mint& a) { return is >> a.x;}

ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {

        // vector size : n + 1

        vector<mint> fact, ifact;

        // precaliculation O(n)

        combination(int n):fact(n+1), ifact(n+1) {

            assert(n < mod);

            // 0! = 1;

            fact[0] = 1;

            // 1! = 0! * 1 ... n! = (n-1)! * n

            for (int i = 1; i <= n; i++) fact[i] = fact[i-1] * i;

            // 1/n! = n!^(-1)

            ifact[n] = fact[n].inv();

            // (n-1)!^(-1) = n!^(-1) * n ... 0!^(-1) = 1!^(-1) * 1

            for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i] * i;

        }

        // combination O(1)

        // nCk = n! / (k! * (n-k)!)

        //     = n! * k!^(-1) * (n-k)!^(-1)

        mint operator()(int n, int k) {

            if (k < 0 || k > n) return 0;

            return fact[n] * ifact[k] * ifact[n-k];

        }

};

/* global variables */

/* function */

/* main */

int main(){

    int S;

    cin >> S;

    // a[n]: S = nの時の答え

    // a[n] = a[n-3] + a[n-4] + ... + a[0]

    // n = n-3 + 3, n-4 + 4, ...,0 + n

    // a[n-1] = a[n-4] + ... + a[0]なので

    // a[n] = a[n-3] + a[n-1]

    vector<mint> a(S+1);

    a[0] = 1;

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

        a[i] = a[i - 1] + a[i - 3];

    }

    cout << a[S] << '\n';

}