#include <iostream>
using namespace std;


int main() {
	long long dp[4001] = {};
	for(int n = 0; n <= 1000; n++) dp[n] = 1;
	for(int k = 1; k < 4; k++) {
		for(int n = 4000; n > 0; n--) {
			for(int i = 1; i <= 1000; i++) {
				if (n-i >= 0) dp[n] += dp[n-i];
			}
		}
	}
	int n;
	while(cin >> n) {
		cout << dp[n] << endl;
	}
}