#include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999;
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define EPS 1e-10
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

double distanceAB(double xa, double ya, double xb, double yb);

/*
class Target
{
public:
	vector <string> draw(int n)
	{

	}
};
*/



int main()
{
	int wa[2001];
	int n;
	
	for (int i=0; i<=1000; i++)
		for (int j=0; j<=1000; j++)
			wa[i+j]++;
	
	while (cin >> n)
	{
		int ans = 0;
		
		for (int i=0; i<=n; i++)
		{
			int sa = n - i;
			ans += wa[i] * wa[sa];
		}
		
		cout << ans << endl;
	}
	
	
	return 0;
}



double distanceAB(double xa, double ya, double xb, double yb)
{
	return sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
}