#include <iostream>
#include <math.h>
using namespace std;

int main() {
	int n;
	while (cin >> n != NULL) {
		int count = 0;
		for (int i = 0; i <= 1000 && i <= n && i+1000*3 >= n; i++) {
			for (int j = 0; j <= 1000 && i+j <= n && i+j+1000*2 >= n; j++) {
				count += n-(i+j)+1;
			}
		}
		cout << count << endl;
	}
	return 0;
}