#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int a;
	while (cin >> a){
		a = min(a, 4000 - a);
		const int aa = min(1000, a);
		int count = 0;
		for (int i = 0; i < aa; i++){
			for (int j = 0; j < aa; j++) {
				for (int k = 0; k < aa; k++) {
					for (int l = 0; l < aa; l++){
						if (i + j + k + l == a) {
							count += 1;
						}
					}
				}
			}
		}
		cout << count+4 << endl;
	}
}