#include #include #include #include #include using namespace std; using Mint = atcoder::modint1000000007; int main() { int N; cin >> N; vector>> DP(N + 1, vector>(N + 1)); function f = [&](int a, int b) { if (a == 0) return Mint(1); if (b > a) return Mint(0); if (DP[a][b]) return *DP[a][b]; return *(DP[a][b] = f(a - b, b) + f(a, b + 1)); }; cout << f(N, 3).val() << endl; }