#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
using namespace std;

int two[2002];
int four[4002];
 
int main(){
  for(int i = 0; i <= 1000; i++){
    for(int j = 0; j <= 1000; j++){
      two[i + j]++;
    }
  }
 
  for(int i = 0; i <= 2000; i++){
    for(int j = 0; j <= 2000; j++){
      four[i + j] += two[i] * two[j];
    }
  }
 
  int n;
 
  while(cin >> n){
    cout << four[n] << endl;
  }
}
