#include <iostream>
#include <string>
#include <cstring>
using namespace std;

int main() {
    long long ans[4][4001];
    memset(ans, 0, sizeof ans);
    for (int i=0; i<=1000; ++i) {
        ans[0][i] = 1;
    }
    for (int k=0; k<3; ++k) {
        for (int i=4000; i>=0; --i) {
            if (ans[k][i] <= 0) continue;
            for (int j=0; j<=1000 && i+j<=4000; ++j) {
                ans[k+1][i+j] += ans[k][i];
            }
        }
    }
    int n;
    while (cin >> n) {
        cout << ans[3][n] << endl;
    }
    return 0;
}