#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <algorithm>
#include <string>
#include <sstream>
 
#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n;
#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif


#if INPUT_FROM_FILE
	while(ifs >> n){
#else
	while(std::cin >> n){
#endif
		std::vector<std::vector<int> > dp(4, std::vector<int>(n + 1, 0));
		int result = 0;
		int max_j = std::min(1000, n);

		for(int j = 0; j <= max_j; j++){
			dp[0][j] = 1;
		}

		for(int i = 1; i <= 3; i++){
			for(int j = 0; j <= n; j++){
				int max_k = std::min(1000, j);
				for(int k = 0; k <= max_k; k++){
					dp[i][j] += dp[i - 1][j - k];
				}
			}
		}

		result = dp[3][n];


		std::cout << result << std::endl;
	}

#if INPUT_FROM_FILE
	//fclose(fp);
#endif
    return 0;
}
