#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int n;
    int ab[2010] = {0};
    int ac[4010] = {0};
    int ad[4010] = {0};

    for(int a = 0;a <= 1000;a++){
        for(int b = 0;b <= 1000;b++){
            ab[a+b]++;
        }
    }
    for(int a = 0;a <= 2*1000;a++){
        for(int b = 0;b <= 1000;b++){
            ac[a+b]+=ab[a];
        }
    }
    for(int a = 0;a <= 3*1000;a++){
        for(int b = 0;b <= 1000;b++){
            ad[a+b]+=ac[a];
        }
    }
     while(cin>>n){
        cout<<ad[n]<<endl;
     }
    return 0;
}