#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit
#include <cstdio>	// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>	// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define DEBUG 0

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
string FILE_NAME = "testcase.0096_";
string NAME;
string itos (int n )
{
	stringstream ss;
	ss << n;

	return ss.str();
}

ll comb (int n, int r ){
	ll res = 1LL;
	rep (i, r ) res *= (ll)(n - i );
	rep (i, r ) res /= (ll)(r-i);

	return res;
}

int main()
{
//	cut here before submit 
#if DEBUG
	NAME = FILE_NAME;
	int CNT = 1;
	NAME += itos (CNT );
	while (freopen (NAME.c_str() , "r", stdin ) != NULL ) {
#endif
	ios_base::sync_with_stdio(0);
	int n;
	while (cin >> n ){
		ll res = 0LL;
		rep (i, 1<<4 ){
			int rems = n;
			int parity = 0;
			rep (j, 4 ) if (i & (1<<j ) ) rems -= (1000 + 1 ), parity++;
			if (rems < 0 ) continue;
			ll curr = comb (rems + 4 - 1, 4 - 1 );		
			res += (parity % 2 == 0 ? curr : -curr );
		} // end rep
		cout << res << endl;
	} // end while			

#if DEBUG
	CNT++;	// cut here before submit
	NAME = FILE_NAME;
	NAME += itos (CNT );
	} // end loop; cut here before submit
#endif			
	return 0;
}