#include<iostream>
#include<cstdio>
using namespace std;

int dp[5][4001];
int main(){
	int n;
	dp[0][0] = 1;
	for (int i = 0; i < 4;i++){
		for (int j = 0; j <= i * 1000;j++){
			for (int k = 0; k <= 1000;k++){
				dp[i + 1][j + k] += dp[i][j];
			}
		}
	}
	/*for (int i = 0; i < 10;i++){
		for (int j = 0; j < 10;j++){
			printf("%d ", dp[i][j]);
		}
		puts("");
	}*/
	while (cin >> n){
		printf("%d\n", dp[4][n]);
	}
	return 0;
}