#include <iostream>
using namespace std;

int main()
{
	int n;
	while (cin >> n)
	{
		long long int dp[5][5001] = {};
		dp[0][0] = 1;
		for (int i = 0; i < 4; i++)
		{
			for (int j = 0; j <= n; j++)
			{
				if (dp[i][j] == 0) continue;
				for (int k = 0; k <= 1000; k++)
				{
					dp[i + 1][j + k] += dp[i][j];
				}
			}
		}

		cout << dp[4][n] << endl;
	}

	return 0;
}