#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int calc(int x){
    if (x < 0 || x > 2000) return 0;
    return min(x+1, 2000-x+1);
}

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

    return 0;
}