#include <iostream>
using namespace std;

// a,b,c,d <= 1000    n <= 4000

int main(){
	long int root[5][4001] = {};
	for (int i = 0; i < 1001; i++) {
		root[1][i] = 1;
	}
	for (int i = 1; i < 5; i++) {
		root[i][0] = 1;
	}
	for (int i = 2; i < 5; i++) {
		for (int j = 1; j < 4001; j++) {
			for (int k = j; k >= 0 && k >= j - 1000; k--) {
				root[i][j] += root[i - 1][k];
			}
		}
	}
	int n;
	while(cin >> n){
		cout << root[4][n] << endl;
	}
	return 0;
}