#include <cstdio>
using namespace std;

int dp[4][4001] = {0};

int main()
{
	for (int i = 0; i <= 1000; i++){
		dp[0][i] = 1;
	}
	
	for (int i = 0; i < 3; i++){
		for (int j = 0; j <= 1000 * (i + 1); j++){
			for (int k = 0; k <= 1000; k++){
				dp[i + 1][j + k] += dp[i][j];
			}
		}
	}
	
	int n;
	while (scanf("%d", &n) != EOF){
		printf("%d\n", dp[3][n]);
	}
	
	return 0;
}