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