 #include<iostream>
 #include<stdio.h>
 #include<cstdlib>
 #include<cstdio>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 #include<deque>
 #include<functional>
 #include<utility>
 #include<list>
 
 using namespace std;
 
 int main()
 {
   int n;
   while(cin>>n)
   {
     long long int count=0;
     if(n<=1000)
     {
       for(int i=0;i<=n;i++) count+=((i+2)*(i+1)/2);
       cout<<count<<endl;  
     }
     else
     {
       long long int count=0;
       map<int,int> mm1;
       map<int,int> mm2;
       map<int,int>::iterator iter;
       for(int a=0;a<=1000;a++)
       {
         for(int b=0;b<=1000;b++)
         {
           mm1[a+b]++;        
         }        
       }
       for(int c=0;c<=1000;c++)
       {
         for(int d=0;d<=1000;d++)
         {
           if(n-c-d>=0) mm2[n-c-d]++;        
         }        
       }
       for(iter=mm1.begin();iter!=mm1.end();++iter)
       {
         if(mm2[iter->first]>0)
         {
           count+=(mm1[iter->first]*mm2[iter->first]);                      
         }                                            
       }
       cout<<count<<endl;
     }
   }
   //while(1);
   return 0;
 }

 