#include <cstdio>
#include <iostream>

#define reep(i,n,m) for(int i=(n);i<(m);i++)
#define rep(i,n) reep(i,0,n)

using namespace std;

typedef long long int ll;

ll dp[5][4001];

int main(){
    dp[0][0] = 1;
    reep(j,1,5){
        rep(i,1001){
            reep(k,i,4001){
                dp[j][k] += dp[j-1][k-i];
            }
        }
    }

    int n;
    while(scanf("%d",&n)!=EOF){
        cout << dp[4][n] << endl;
    }
    return 0;
}