stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

#define ll long long int

ll dp[20009];

ll n,m;

ll call(ll rem)

{

    if(rem==0)

    {

        return 1;

    }

    if(rem==1 || rem==2)

    {

        return 0;

    }

    if(dp[rem]!=-1)

    {

        return dp[rem];

    }

    ll i,x,y;

    x=0;

    for(i=3;i<=rem;i++)

    {

        y=call(rem-i);

        x=(x+y)%m;

    }

    return dp[rem]=x%m;

}

int main()

{

    ll a,b,c,d,e,i,j,k,l,x,y,t,p;

    m=(1e9)+7;

    cin>>n;

    if(n<3)

    {

        printf("0\n");

        return 0;

    }

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

    x=call(n);

    x=x%m;

    cout<<x<<endl;

}


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

using namespace std;

#define ll long long int

ll dp[2009];

ll n,m;

ll call(ll rem)

{

    if(rem==0)

    {

        return 1;

    }

    if(rem==1 || rem==2)

    {

        return 0;

    }

    if(dp[rem]!=-1)

    {

        return dp[rem];

    }

    ll i,x,y;

    x=0;

    for(i=3;i<=rem;i++)

    {

        y=call(rem-i);

        x=(x+y)%m;

    }

    return dp[rem]=x%m;

}

int main()

{

    ll a,b,c,d,e,i,j,k,l,x,y,t,p;

    m=(1e9)+7;

    cin>>n;

    if(n<3)

    {

        printf("0\n");

        return 0;

    }

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

    x=call(n);

    x=x%m;

    cout<<x<<endl;

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



using namespace std;



const int mod=1e9+7;

long long dp[700][2002];



long long DP(int cur,long long sum)

{

    if(sum == 0)return dp[cur][0]=1;

    if(sum < 3)return dp[cur][sum]=0;

    long long &ans=dp[cur][sum];

    if(ans > -1)return ans;

    ans=0;

    for(int i=3;i<=sum;i++)ans=(ans+DP(cur+1,sum-i))%mod;

    return ans;

}



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);cout.tie(NULL);

    int n;

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

    cin >> n;

    cout << DP(1,n);

    return 0;

}


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



using namespace std;



const int mod=1e9+7;

long long dp[2002];



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);cout.tie(NULL);

    int i,j,n;

    cin >> n;

    dp[0]=1;

    for(i=1;i<=n;i++)

    {

        for(j=3;j<=i;j++)

        {

            dp[i]+=dp[i-j];

            dp[i]%=mod;

        }

    }

    cout << dp[n];

    return 0;

}
// Slower C++ solution:
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

//#include <atcoder/all>

//using namespace atcoder;

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 YES cout<<"YES"<<endl

#define NO cout<<"NO"<<endl

const double PI=3.14159265358979323846;

const in MOD = 1000000007;

const in INF=1e18+7;

const int inf=1e9+7;

using P=pair<int,int>;

vector<int> dx={0,1,-1,0};

vector<int> dy={1,0,0,-1};





int main(){

ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

cout << fixed << setprecision(10);

    int s;

    cin>>s;

    vector<vector<in>> dp(666,vector<in>(s+1,0));

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

    in ans=0;

    ans += dp[0][s];



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

        in sum=0;

        REP(j,4,s+1){

            sum += dp[i-1][j-3];

            sum %= MOD;

            dp[i][j]=sum;

        }

        ans += dp[i][s];

        ans %= MOD;

    }

    cout<<ans<<endl;

}/*

./problem.exe

*/

// Faster C++ solution for the same problem (measured speedup: 1.9201566347582295x):
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

//#include <atcoder/all>

//using namespace atcoder;

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 YES cout<<"YES"<<endl

#define NO cout<<"NO"<<endl

const double PI=3.14159265358979323846;

const in MOD = 1000000007;

const in INF=1e18+7;

const int inf=1e9+7;

using P=pair<int,int>;

vector<int> dx={0,1,-1,0};

vector<int> dy={1,0,0,-1};





int main(){

ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

cout << fixed << setprecision(10);

    int s;

    cin>>s;

    vector<vector<in>> dp(max(s/3,1),vector<in>(s+1,0));

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

    in ans=0;

    ans += dp[0][s];



    for(int i=1;i<s/3;i++){

        in sum=0;

        REP(j,3*i+3,s+1){

            sum += dp[i-1][j-3];

            sum %= MOD;

            dp[i][j]=sum;

        }

        ans += dp[i][s];

        ans %= MOD;

    }

    cout<<ans<<endl;

}/*

./problem.exe

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

using namespace std;

#define ll long long 

#define pb push_back

#define M 1000000007

#define all(v) (v).begin(),(v).end()

#define rall(v) (v).rbegin(),(v).rend()

const int N = 1e6 + 1;

int dp[670][2001] , S;

int calc(int u , int sum){

	if(sum == S)return 1;

	if(sum > S)return 0;

	int& ret = dp[u][sum];

	if(ret+1)return ret;

	ret = 0;

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

		ret += calc(u+1 , sum+i);

		if(ret >= M)ret -= M;

	}

	return ret%M;

}

int main(){	

	cin >> S;

	memset(dp , -1 ,sizeof dp);

	cout << calc(0 , 0) << endl;

	

	

		

}	

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

using namespace std;

#define ll long long 

#define pb push_back

#define M 1000000007

#define all(v) (v).begin(),(v).end()

#define rall(v) (v).rbegin(),(v).rend()

const int N = 1e6 + 1;

int dp[3000] , S;

int main(){	

	cin >> S;

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

		if(++dp[i] >= M) dp[i] -= M;

		for (int j = 3; j <= S && i - j >= 3; ++j){

			dp[i] += dp[i-j];

			if(dp[i] >= M) dp[i] -= M;

		}

	}

	cout << dp[S] << endl;

	

	

		

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

using namespace std;

long long mod = 1e9+7;

int mark[200003] = {};

int limit = 0;

long long dp[200005] = {};

long long getSum(long long n)

{

    if(dp[n] != -1 && n >= 0)

    {

        return dp[n];

    }

    if(n == 0)

    {

        return 1;

    }

    if(n < 0)

    {

        return 0;

    }

    long long res = 0;

    for(int i = 1; i <= limit; i++)

    {

        if(n-mark[i] >= 0)

        {

            res =(res+getSum(n-mark[i]))%mod;

        }

    }

    return dp[n] = res%mod;

}

void solve()

{

    long long n; cin >> n;

    for(int i = 3; i <= n; i++)

    {

        limit++;

        mark[limit] = i;

    }

    long long sum = getSum(n)%mod;

    cout << sum << endl;

}

int main()

{

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

    solve();

    return 0;

}


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

using namespace std;

long long mod = 1e9+7;

int mark[2009] = {};

int limit = 0;

long long dp[2050] = {};

long long getSum(long long n)

{

    if(dp[n] != -1 && n >= 0)

    {

        return dp[n];

    }

    if(n == 0)

    {

        return 1;

    }

    if(n < 0)

    {

        return 0;

    }

    long long res = 0;

    for(int i = 1; i <= limit; i++)

    {

        if(n-mark[i] >= 0)

        {

            res =(res+getSum(n-mark[i]))%mod;

        }

    }

    return dp[n] = res%mod;

}

void solve()

{

    long long n; cin >> n;

    for(int i = 3; i <= n; i++)

    {

        limit++;

        mark[limit] = i;

    }

    long long sum = getSum(n)%mod;

    cout << sum << endl;

}

int main()

{

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

    solve();

    return 0;

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

using namespace std;

long long mod = 1e9+7;

int mark[200003] = {};

int limit = 0;

long long dp[200005] = {};

long long getSum(long long n)

{

    if(dp[n] != -1 && n >= 0)

    {

        return dp[n];

    }

    if(n == 0)

    {

        return 1;

    }

    if(n < 0)

    {

        return 0;

    }

    long long res = 0;

    for(int i = 1; i <= limit; i++)

    {

        if(n-mark[i] >= 0)

        {

            res =(res+getSum(n-mark[i]))%mod;

        }

    }

    return dp[n] = res%mod;

}

void solve()

{

    long long n; cin >> n;

    for(int i = 3; i <= n; i++)

    {

        limit++;

        mark[limit] = i;

    }

    long long sum = getSum(n)%mod;

    cout << sum << endl;

}

int main()

{

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

    solve();

    return 0;

}


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

using namespace std;

long long mod = 1e9+7;

int mark[2009] = {};

int limit = 0;

long long dp[2050] = {};

long long getSum(long long n)

{

    if(dp[n] != -1)

    {

        return dp[n];

    }

    if(n == 0)

    {

        return 1;

    }

    long long res = 0;

    for(int i = 1; i <= limit; i++)

    {

        if(n-mark[i] >= 0)

        {

            res =(res+getSum(n-mark[i]))%mod;

        }

    }

    return dp[n] = res%mod;

}

void solve()

{

    long long n; cin >> n;

    for(int i = 3; i <= n; i++)

    {

        limit++;

        mark[limit] = i;

    }

    long long sum = getSum(n)%mod;

    cout << sum << endl;

}

int main()

{

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

    solve();

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.606914622500477x):
#include<iostream>

#include<math.h>

#include<algorithm>

typedef long long ll;

const ll mod=1e9+7;

using namespace std;

ll n,a,b;

ll dp[2010];

int main(){

cin>>n;

for (int i=3;i<10;i++)

dp[n-i]= 1;

dp[n]=1;

for (int i=n-3;i>=0;i--){

for (int j= 3;j<10;j++){

dp[i-j]=(dp[i-j+1]+dp[i])%mod;

}

}

cout<<dp[0];

return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.3068673724391235x):
#include<iostream>

#include<cstdio>

#include<cstring>

#include<algorithm>

#include<bits/stdc++.h>

using namespace std;

typedef long long int ll;

const ll mod=1e9+7;

ll dp[3000]={0};

int main()

{

	ll v;

	scanf("%lld",&v);

	if(v<3){

		printf("0\n");return 0;

	}

	dp[0]=1;

	for(ll i=0;i<=v;i++){

		for(ll j=3;j+i<=v;j++){

			dp[j+i]=dp[j+i]+dp[i];

			dp[j+i]=dp[j+i]%mod;

		}

	} 

	printf("%lld\n",dp[v]);

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.5422081573257125x):
#include <iostream>

using namespace std;

int n,i,j,a[2001];

int main()

{

    cin>>n;

    a[3]=1;

    a[4]=1;

    a[5]=1;

    for(i=6;i<=2000;i++)

    {

        a[i]=((a[i-2]+a[i-3])%1000000007+a[i-4]%1000000007)%1000000007;

    }

    cout<<a[n]<<endl;

    //system("pause");

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

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

using namespace std;

long long n,dp[2005]={0,0,0,1,1,1};

const long long mod=1000000007;

int main()

{

	scanf("%d",&n);

	for(int i=6;i<=n;i++)

	{

		for(int j=0;j<=i-3;j++)

		{

			dp[i]=(dp[i]+dp[j])%mod;

		}

		dp[i]+=1;

		dp[i]%=mod;

	}

	printf("%lld\n",dp[n]);

 	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.341738629409732x):
#include <iostream>

using namespace std;

int s;

long long f[2005];

const int mod=1e9+7;

/*

¿¼ÊÔµÄÊ±ºòÊ²Ã´¶¼ÏëÁË 

Ïë¹ý´ò±í£¨Ëã²»³ö±í£©Ïë¹ý×Ü·½°¸¼õ£¨Á¬×Ü·½°¸¶¼Ëã²»³öÀ´£© 

ÍòÍòÃ»Ïëµ½ÕâÊÇ¸ödp 

f[i]±íÊ¾°Ñi°´ÕÕÌâÒâ·Ö½âµÄ·½°¸ 

µ±i>=6Ê±£¬f[i]=sum(f[i-j])£¬3<=j<=i-3 

¾ÍÍêÁË 

*/ 

int main()

{

    cin>>s;

    if(s<3)

    {

    	cout<<0<<endl;

    	return 0;

	}

	for(int i=3;i<=s;i++)

	{

		f[i]=1;//Ö»ÓÐËü×Ô¼º 

		for(int j=3;i-j>=3;j++)

			f[i]=(f[i]+f[i-j])%mod;

	}

    cout<<f[s]<<endl;

    system("pause");

    return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

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



using namespace std;

#define ll long long

#define ull unsigned long long

#define pb push_back

#define lin "\n"

#define fast_io ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(0)

#define mod 1000000007

ll dp[2005];



void khelo() {

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

    for (int i = 6; i <= 2000; ++i) {

        dp[i] = (dp[i - 1] + dp[i - 3]) % mod;

    }

}



void solve() {

    int n;

    cin >> n;

    cout << dp[n];

}



int main() {

//        fast_io;

    khelo();

    int t = 1;

    //    cin >> t;

//    scanf("%d", &t);

    int c = 1;

    while (t--) {

//        printf("Case %lld:\n", c);

        //        cout<<"Case "<<c<<": ";

        solve();

        c++;

    }

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.179891785735782x):
/*

* @Author: Nazrul Islam

* @Date:   2020-09-21 00:43:11

* @Last Modified by:   Nazrul Islam

* @Last Modified time: 2020-09-21 00:56:42

*/



#include<bits/stdc++.h>

using namespace std;

#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

typedef long long ll; 

typedef double dd;

typedef vector<int> vi;

typedef vector<char> vc;

typedef list<int> li;

typedef set<int> si;

typedef map<int,int> mp;

#define pb push_back

#define pf push_front

#define mk make_pair

#define sc scanf

#define pr printf

#define pi acos(-1.0)

#define endl '\n'

// char s[200009];

// char st[200009];

// int a[600][600];

// int b[29][10];

// int a[200009];

// int c[200009];

ll dp[2003];

ll m = 1e9+7;



ll mod(ll n) {

	return ((n%m + m)%m);

}



ll add(ll a, ll b) {

	return mod(mod(a) + mod(b));

}



ll result(ll n) {

	if(n == 0) return 1;

	else if(n < 3) return 0;

	else if(n >= 3 && n < 6) return 1;

	else if(dp[n] != -1) return dp[n];

	else {

		ll p = 0;

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

			if(n-i >= 0)

				p = add(p, result(n-i));

		}

		

		return dp[n] = p;

	}

}



void solve()

{

	ll n;

	cin >> n;

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

	dp[0] = 1;

	ll q = result(n);

	cout << q%m << endl; 

}

int main()

{

	IO;

	int t; 

	t = 1;

	// cin >> t;

	while(t--)

		solve();

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.2862017634354186x):
/*

* @Author: Kabid

* @Date:   {{create_time}}

* @Last Modified by:   Kabid

* @Last Modified time: 2020-09-21 11:25:16

*/

#include<bits/stdc++.h>

#include<cstdlib>

using namespace std;

#define ll long long

#define  in(x) scanf("%d",&x);

#define out(x) printf("%d",x);

#define  ins(x)  scanf("%s",x);

#define outs(x) printf("%s",x);

#define lin puts("");

#define _ putchar(' ');



int t;       //test cases

ll i, j;	 //iterators

ll n, k ,  q,  d, m, c, c1, c2, d1, x; //variables;

ll mx1 = LLONG_MIN, mx2 = LLONG_MIN, mx = LLONG_MIN, mn = LLONG_MAX;		// max min

char s[6], s1, s2;		// string

ll a [1000001], b [200001] ;

bool mox [1000001];	// array

map <int, int > mp;

vector <vector<ll>> vc;

vector <ll> v;

set <ll> st;

bool r;

ll p = 1000000007;





int main() {

	ios_base::sync_with_stdio(0);

	cin.tie(0);

	//cin >> t; q = t;

	t = 1;



	while (t--) {



		cin >> n;

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

		for (i = 4; i <= n; i++) {

			c = 0;

			for (j = 3; j <= i; j++) {

				c = (c + a[i - j]) % p;

			}

			a[i] = c;

		}

		cout << a[n] << endl;

	}

	return 0;



}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.276799347408172x):
#include<iostream>

#include<stdio.h>

#include<vector>

#include<algorithm>

#include<math.h>

#include<set>

#include<map>

#include<time.h>

#include<cstring>

#include<iomanip>

#include<numeric>

#include<list>

#include<stack>

#include<sstream>

#define lli long long int

#define h 1000000007

#define s 2010

#define pf push_front

#define pb push_back

#define ub upper_bound

#define lb lowepr_bound

#define mp make_pair

#define pi 3.14159

using namespace std;

vector<lli>a(s,-1);

lli solve(lli sum)   

{

	lli i, cnt;

	if(sum==0)return 1;

	else if(sum>=3 && sum<=5) return 1;

	else if(a[sum]!=-1)return a[sum];

	else

	{

		cnt=0;

		for(i=3;i<=sum;i++) 

		{ if((sum-i)>=0)

	  	cnt=((cnt%h)+(solve(sum-i)%h))%h;

	  	else break;

	  } 

		a[sum]=cnt;

		return a[sum];

	} 

} 

int main() 

{

  ios_base::sync_with_stdio(false);

  cin.tie(NULL) ;

  lli i, n;

  cin>>n;

  cout<<solve(n)<<endl;

  return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

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

using namespace std;

using ll = long long;

const ll MOD = 1e9 + 7;

ll S[2007];

int main()

{

    ll N;

    cin >> N;

    if(N<=2) cout << 0 << endl;

    else {

        ll ans  = 0;

        S[0] = 1;S[1] = 1;S[2] = 1;

        for(ll i=3;i<=N;i++)

        {

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

            S[i] %= MOD;

        } cout << S[N-3] << endl;

    }

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.606914622500477x):
#include<iostream>

#include<math.h>

#include<algorithm>

typedef long long ll;



using namespace std;



ll n, a, b;

ll dp[2005];



int main() {

	cin >> n;

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

		dp[n - i] = 1;

	}

	dp[n] = 1;

	for (int i = n-3; i >= 0; i--){

		for (int j = 3; j < 10; j++){

			dp[i - j] = (dp[i - j + 1] + dp[i])%1000000007;

		}

	}

	cout << dp[0];

	return 0;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

// Faster C++ solution for the same problem (measured speedup: 2.2972093632763975x):
#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;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

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

using namespace std;

typedef long long ll;

const ll m=1e9+7;

ll s,dp[2005];

int main()

{

	cin>>s;

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

	ll now=2;

	for(int i=5;i<=s;i++)

	{

		dp[i]=(1+now-dp[i-1]-dp[i-2])%m;

		now+=dp[i];

	}

	cout<<dp[s]%m<<endl;

}
// Slower C++ solution:
#include<iostream>

using namespace std;

typedef long long int ll;

const int maxn=2e5+10;

const int mod=1e9+7;

ll a[maxn];

int main(){

	a[1]=0;

	a[2]=0;

	a[3]=1;

	for(int i=4;i<maxn;i++){

		a[i]=(a[i-1]+a[i-3])%mod;

	}

	int n;

	cin>>n;

	cout<<a[n]<<endl;

}

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



#define rr(i, b)    for (int i = 0; i < int(b); i++)

#define vi(n, a) vector <long long> a(n); rr(i, n) cin >> a[i]

#define pvec(a) rr(i, a.size()) cout << a[i] << " "; cout << endl

#define bug(x) cout << #x << " " << x << endl

#define ll long long

#define vii vector <int>

#define PI acos(-1)



int mod = 1e9 + 7;



using namespace std;

int k;



bool check(string s) {



    int l = 0;

    int r = s.size()/2;



    while(r != s.size()) {

        if(s[l] != s[r]) {

            return false;

        }

        l++;

        r++;

    }



    return true;

}



vector<long long> fac(20 + 1);



void fact() {

    fac[0] = 1;

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

        fac[i] = fac[i - 1] * i;

    }

}



void solve() {

    int s;

    cin >> s;



    vii ans(s + 1, 0);



    ans[0] = 1;



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

        ans[i] = (ans[i - 1] + ans[i - 3]) % mod;

    }



    cout << ans[s] << endl;

}

 

int main(){

    cin.tie(0);

    ios_base::sync_with_stdio(false);

    //fact();

    int t = 1;

    //cin >> t;



    for(k = 1; k <= t; k++) {

        solve();

    }

    return 0;

}