 #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<=3000)
     {
       for(int i=0;i<=n;i++) count+=((i+2)*(i+1)/2);
       cout<<count<<endl;  
     }
     else
     {
       bool flag=false;
       for(int a=0;a<=1000;a++)
       {
         if(a>n&&(n-a>3000)) break;      
         for(int b=0;b<=1000;b++)
         {
           if((a+b)>n&&(n-a-b>2000)) break;
           for(int c=0;c<=1000;c++)
           {
             if((a+b+c)>n) break;
             int kk=n-a-b-c;
             if(kk>=0&&kk<=1000) count++;        
           }
         }        
       }        
       cout<<count<<endl;
     }
   }
   //while(1);
   return 0;
 }

 
  