#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cstdio>
#define sort(i) sort(i.begin(),i.end())
using namespace std;

signed main() {
	int a[2001]{};
	for (int b = 0; b < 1001; b++) {
		for (int c = 0; c < 1001; c++) {
			a[b + c]++;
		}
	}
	int b[4001]{};
	for (int c = 0; c < 2001; c++) {
		for (int d = 0; d < 2001; d++) {
			b[c + d] += a[c] * a[d];
		}
	}
	int s;
	while (cin >> s) {
		cout << b[s] << endl;
	}
}