#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//????????????????????????????????????
#define int long long
#define str string
typedef long long ll;
typedef long double ld;
const ll inf = 999999999999999999;
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {
	ll to, cost;
};
ll gcm(ll i, ll j) {//?????§??¬?´???°
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
//---------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++
int n, dp[5][4001];
signed main() {
	dp[0][0] = 1;
	for (int i = 0; i < 4; i++) {
		for (int j = 0; j <= 4000; j++) {
			for (int z = 0; z <= 1000; z++) {
				if (j + z > 4000)
					break;
				dp[i + 1][j + z] += dp[i][j];
			}
		}
	}
	while (cin >> n) {
		cout << dp[4][n] << endl;
	}
	getchar(); getchar();
}