#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

int main()
{
    for(;;){
        int n;
        if(!(cin >> n))
            return 0;

        vector<vector<long long> > a(5, vector<long long>(n+1, 0));
        a[0][0] = 1;
        for(int i=0; i<4; ++i){
            for(int j=0; j<=n; ++j){
                for(int k=0; k<=1000; ++k){
                    int x = j + k;
                    if(x <= n)
                        a[i+1][x] += a[i][j];
                }
            }
        }

        cout << a[4][n] << endl;
    }
}