#include <iostream>

using namespace std;
int memo_tmp[2002];
int memo[4002];

void solve()
{
	for(int i = 0; i <= 1000; ++i)
	{
		for(int j = 0; j <= 1000; ++j)
		{
			++memo_tmp[i + j];
		}
	}
	for(int i = 0; i <= 2000; ++i)
	{
		for(int j = 0; j <= 2000; ++j)
		{
			memo[i + j] += memo_tmp[i] * memo_tmp[j];
		}
	}
	int n;
	while(cin >> n)
	{
		cout << memo[n] << endl;
	}
}

int main()
{
	solve();
	return(0);
}