#include <iostream>
#include <stdio.h>
using namespace std;

int main() {
   int n,s,i,a,b,c;
   while(cin >> n) {
	   s=0;
	   i= n>2000 ? n-2000 : 0;
	   c= n<2001 ? n : 2000; 
	   for (i;i<=c;i++) {
		   a= i<1001 ? i+1 : 2000-i+1;
		   b= (n-i)<1001 ? n-i+1 : 2000-(n-i)+1;
           s=s+a*b;
	   }
	   cout << s << endl;
   }
   return 0;
}