#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

ll f(int n)
{
    if(n<0 || 2000<n) return 0;
    return min(n+1, 2001-n);
}

int main()
{
    int n;
    while(cin >> n){
        ll ans = 0;
        rep(i, n+1){
            ans += f(i) * f(n-i);
        }
        cout << ans << endl;
    }
}