#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int a[4005] = {0};
    int n;

    rep(i,1001) rep(j,1001) a[i + j]++;

    while(cin >> n){
        int ans = 0;
        rep(i,n + 1){
            ans+= a[i] * a[n - i];
        }
        cout << ans << endl;
    }
}