#include<iostream>

using namespace std;


main(){
  int a,b,c,d,n,count[100],j;
  
  for(j = 0 ; j < 100 ; j++){
    count[j] = 0;
  }
  
  j = 0;
  while(cin >> n){

      if(n > 2000){
	n = n - 2000;
	n = 2000 - n;
      }
      
      for(a = 0; a <= 1000; a++){
	if(a > n)break;
	for(b = 0; b <= 1000; b++){
	  if(a + b >n) break;
	  for(c = 0; c <= 1000; c++){
	    if(n-(a+b+c) > 1000 || n-(a+b+c) < 0)break;
	    else{
	      
	      count[j] = count[j] + 1;
	    }
	  } 
	}
      }
      cout << count[j] << endl;
    j++;
  }

}