#include<iostream>
using namespace std;
int main(){
	int n;
	while (cin >> n){
		long long sum = 0;
		for (int a = 0; a <= 1000; a++) {
			for (int b = 0; b <= 1000; b++) {
				if (n - a - b <= 2000)sum += 2000 - (n - a - b) + 1;
			}
		}
		cout << sum << endl;
	}
}