// #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>	// istringstream
using namespace std;

vector<int> solve(vector<int> list){
	// 1000*1000までなら計算スピード早い.
	for (int i = 0; i <= 1000; i++){
		for (int j = 0; j <= 1000; j++){
			list[i + j]++;
		}
	}

	return list;
}

int main(){
	// a+bの組み合わせ数 * c+dの組み合わせ数
	// sankou http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=612299#1
	// sankou http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=614745#1
	int n;
	vector<int> list(2001, 0);

	list = solve(list);

	while (cin >> n){
		long int ans = 0;
		for (int i = 0; i <= 2000; i++){
			for (int j = 0; j <= 2000; j++){
				if (i + j == n){
					ans += list[i] * list[j];
				}
			}
		}
		cout << ans << endl;
	}

	return 0;
}