#line 1 "d.cpp"
// -----------------------------------
// author   : MatsuTaku
// country  : Japan
// created  : 09/13/20 20:47:40
// -----------------------------------

#include <bits/stdc++.h>
#line 2 "/mnt/c/Users/tkmma/competitive_programming/CPBF/library/include/combination.hpp"

#line 3 "/mnt/c/Users/tkmma/competitive_programming/CPBF/library/include/modular.hpp"

template <long long MOD>
class Modular {
 private:
  long long val_;

 public:
  constexpr Modular() : val_(0) {}
  constexpr Modular(long long v) : val_(v%MOD) {
    if (val_ < 0) val_ += MOD;
  }

  constexpr long long val() const { return val_; }
  constexpr Modular operator+(Modular x) const { return (val() + x.val())%MOD; }
  constexpr Modular operator+=(Modular x) { return *this = *this + x; }
  constexpr Modular operator++() { return *this += 1; }
  constexpr Modular operator++(int) { Modular c = *this; ++(*this); return c; }
  constexpr Modular operator-(Modular x) const { return (val() + MOD - x.val())%MOD; }
  constexpr Modular operator-=(Modular x) { return *this = *this - x; }
  constexpr Modular operator--() { return *this -= 1; }
  constexpr Modular operator--(int) { Modular c = *this; --(*this); return c; }
  constexpr Modular operator*(Modular x) const { return (val() * x.val())%MOD; }
  constexpr Modular operator*=(Modular x) { return *this = *this * x; }
  friend constexpr Modular pow(Modular x, long long p) {
    Modular t = 1;
    Modular u = x;
    while (p) {
      if (p & 1)
        t *= u;
      u *= u;
      p >>= 1;
    }
    return t;
  }
  constexpr Modular operator/(Modular x) const { return *this * pow(Modular{x}, MOD-2); }
  constexpr Modular operator/=(Modular x) { return *this = *this / x; }

  constexpr bool operator==(Modular x) const { return val() == x.val(); }
  constexpr bool operator!=(Modular x) const { return val() != x.val(); }
  constexpr bool operator<(Modular x) const { return val() < x.val(); };
  constexpr bool operator<=(Modular x) const { return val() <= x.val(); };
  constexpr bool operator>(Modular x) const { return val() > x.val(); };
  constexpr bool operator>=(Modular x) const { return val() >= x.val(); };

  friend std::ostream& operator<<(std::ostream& os, const Modular& x) {
    return os << x.val();
  }
  friend std::istream& operator>>(std::istream& is, Modular& x) {
    return is >> x.val_;
  }

};

#line 4 "/mnt/c/Users/tkmma/competitive_programming/CPBF/library/include/combination.hpp"

template <unsigned int MOD, unsigned int MAX>
class Combination {
 public:
  using mint = Modular<MOD>;
 private:
  mint fact_[MAX+1];
  mint ifact_[MAX+1];

 public:
  constexpr Combination() {
    fact_[0] = 1;
    for (size_t i = 1; i <= MAX; ++i) {
      fact_[i] = fact_[i-1] * i;
    }
    ifact_[MAX] = mint(1)/fact_[MAX];
    for (int i = MAX-1; i >= 0; i--) {
      ifact_[i] = ifact_[i+1] * (i+1);
    }
  }

  mint operator()(int p, int q) const {
    if (p < q) return 0;
    return fact_[p] * ifact_[q] * ifact_[p-q];
  }

  mint fact(int p) const {
    return fact_[p];
  }
  mint ifact(int p) const {
    return ifact_[p];
  }

};

#line 9 "d.cpp"

using namespace std;
using ll = long long;

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

  int s; cin>>s;
  Combination<(int)1e9+7, 4000> cmb;
  Modular<(int)1e9+7> ans = 0;
  for (int i = 1; i <= s/3; i++) {
    int m = s-3*i;
    ans += cmb(m+i-1, i-1);
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3792