#include<iostream>
using namespace std;
#define rep(i,n) for(i = 0;i <= n;i++)

int num[2001];
int main(){
	int i,j,n;
	int count[1001] = {0},cor = 0;
	rep(i,1000){
		rep(j,1000){
			num[i+j]++;
		}
	}
	while(cin >> n){
		rep(i,2000){
			if(n-i < 0)break;
			if(n-i <= 2000)
				count[cor] += num[i]*num[n-i];
		}
		cor++;
	}
	rep(i,cor-1)
		cout << count[i] << endl;
	return 0;
}