#include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define pb(a) push_back(a)
#define mk(a,b) make_pair(a,b)
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int main(){
	int n;
	vi v(2001);
	rer(i,0,1000){
		rer(j,0,1000){
			v[i+j]++;
		}
	}
	while(cin>>n){
		int ans=0;
		/*sort(all(v));
		rep(i,0,v.size()){
			ans+=upper_bound(all(v),n-v[i])-lower_bound(all(v),n-v[i]);
		}*/
		/*rer(i,0,min(1000,n)){
			rer(j,0,min(1000,n)){
				if((n-i-j)<0) continue;
				ans+=upper_bound(all(v),n-i-j)-lower_bound(all(v),n-i-j);
			}
		}*/
		rer(i,0,v.size()){
			rer(j,0,v.size()){
				if(i+j==n) ans+=(v[i]*v[j]);
			}
		}
		o(ans);
	}
}