#include <bits/stdc++.h>
using namespace std;

#define FOR(i,l,r) for(int i = (int) (l);i < (int) (r);i++)
#define ALL(x) x.begin(),x.end()
template<typename T> bool chmax(T& a,const T& b){ return a < b ? (a = b,true) : false; }
template<typename T> bool chmin(T& a,const T& b){ return b < a ? (a = b,true) : false; }
typedef long long ll;

ll N;
map<ll,ll> mp;

int main()
{
	FOR(i,0,1001) FOR(j,0,1001){
		mp [i + j]++;
	}

	while(~scanf("%lld",&N)){
		ll ans = 0;
		FOR(i,0,N + 1){
			ans += mp [i] * mp [N - i];
		}
		printf("%lld\n",ans);
	}

	return 0;
}