#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int n, s;
int count = 0;
int dp[4001][4];
long long int solve(int i, int j);

int main(void){
	
	while(cin >> n){
		fill_n(*dp,4001*4,-1);
		cout << solve(0,0) << endl;
	}
}
long long int solve(int sum, int cnt){
	if(dp[sum][cnt] != -1){return dp[sum][cnt];}
	if(cnt == 4){
		if(sum == n){return 1;}
		else return 0;
	}
	long long int t = 0;
	for(int i = 0; i < 1000; i++){
		if(i > n){continue;}
		t += solve(sum + i, cnt+1);
	}
	return dp[sum][cnt] = t;
}