import std.stdio, std.algorithm;

void main() {
    auto p = new long[2001];
    foreach (i; 0 .. 1001) foreach (j; 0 .. 1001)
        p[i + j]++;
    while (true) {
        if (stdin.eof) break;
        int N; scanf("%d\n", &N);
        long ans;
        foreach (i; 0 .. min(N, 200) + 1)
            ans += p[i] * p[N - i]; 
        writeln(ans);
    }
}