#include <iostream>
#include <numeric>

using namespace std;

int main() {
    int n;
    int dp[4001];
    while (true) {
        cin >> n;
        if (cin.eof()) {
            return 0;
        }
        for (int i=0; i<=1000; i++) {
            dp[i] = 1;
        }
        for (int i=1001; i<=n; i++) {
            dp[i] = 0;
        }
        for (int i=0; i<3; i++) {
            for (int j=n; j>=0; j--) {
                int *begin = dp+max(0, j-1000);
                int *end = dp+j+1;
                dp[j] = accumulate(begin, end, 0);
            }
        }
        cout << dp[n] << endl;
    }
}