#include <iostream>

using namespace std;

int n;
int dp[5][4001];

int main() {
    fill(dp[0], dp[5], 0);
    dp[0][0] = 1;
    for (int i = 1; i <= 4; i++) {
        for (int j = 0; j <= 4000; j++) {
            for (int k = 0; k <= 1000; k++) {
                if (j + k <= 4000)
                    dp[i][j + k] += dp[i - 1][j];
            }
        }
    }
    while (cin >> n) {
        cout << dp[4][n] << endl;
    }
}
