#include<bits/stdc++.h>
#define rep(i,n)for(ll i=0;i<n;i++)
using namespace std;
typedef long long ll;

int main() {
	ll n;
	while (cin >> n) {
		ll cnt = 0;
		for (ll i = 0; i <= min(n, 1000LL); i++)
			for (ll j = 0; j <= min(n - i, 1000LL); j++)
				if (n - i - j <= 2000)cnt += n - i - j + 1;
		cout << cnt << endl;
	}
	return 0;
}