
#include<bits/stdc++.h>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

int n;

bool input(){
  return cin>>n;
}

int solve(){
  const int M = 1000;
  const int N = M*2;

  int val[N+1] = {0};

  reps(i,0,M+1){
    reps(j,0,M+1){
      val[i+j]++;
    }
  }

  int sum = 0;
  rep(i,N){
    if(n-i>=0)
    sum += val[i] * val[n-i];
  }

  //  rep(i,10)printf("%d ",val[i]);puts("");
  return sum;
  

}

int main(){

  while(input()){
    cout<<solve()<<endl;
  }
}