#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <set>
#include <complex>
#include <cmath>
#include <cstring>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59
using ld = long double;

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(6);

    int n;

    ll arr[5][5010] = {0};

    arr[0][0] = 1;
    for (int i = 0; i < 4; ++i)
    {
        for (int j = 0; j <= 4000; ++j)
        {
            for (int k = 0; k <= 1000; ++k)
            {
                if (j - k >= 0)
                    arr[i + 1][j] += arr[i][j - k];
                else
                    break;
            }
        }
    }

    //cout << arr[4][0] << endl;
    while (cin >> n)
    {
        cout << arr[4][n] << endl;
    }
    return 0;
}
