#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int dp[5][4001];

int main()
{

    dp[0][0] = 1;

    for (int i = 1; i <= 4; i++)
    {
        rep(j, 4001)
        {
            rep(k, 1001)
            {
                if (j - k >= 0)
                    dp[i][j] += dp[i - 1][j - k];
            }
        }
    }

    int n;
    while (cin >> n)
    {
        OP(dp[4][n]);
    }
    return 0;
}
