#include<bits/stdc++.h>
using namespace std;
long int n,a[4005],memo[4005],ans;

int main(){

     for(int i=0;i<=1000;i++){
        for(int j=0;j<=1000;j++){
            a[i+j]++;
        }
     }

    while(scanf("%d",&n)!=EOF){

    for(int i=0;i<4001;i++)memo[i]=0;

    for(int i=0;i<2001;i++){
        for(int j=0;j<2001;j++){
                memo[i+j]+=a[i]*a[j];
        }
    }
    cout << memo[n] << endl;

    }

return 0;
}