#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin(); it!=(c).end(); it++)
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define pr(a) cout << (a) << endl
typedef long long ll;
typedef pair<int,int> P;
const int MAX=1000000000;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

int a[2001]={},b[4001]={};
int main() {
  rep(i,1001) {
    rep(j,1001) a[i+j]++;
  }
  rep(i,2001) {
    rep(j,2001) b[i+j]+=a[i]*a[j];
  }
  int n;
  while(cin >> n) pr(b[n]);
  return 0;
}
