#include <iostream>
#include <array>

std::array<long long int, 4001> ans;

void solve(int sum, int num) {
    if (num != 1) {
        int new_num = num + 1;
        for (int i = 0; i <= 1000; ++i) {
            solve(sum + i, new_num);
        }
    }
    else {
        for (int i = 0; i <= 1000; ++i) {
            ++ans[sum + i];
        }
    }
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    
    solve(0, 0);

    int n;

    while (std::cin >> n) {
        int sum = 0;
        for (int i = 0; i <= n; ++i) {
            sum += ans[i] * ans[n - i];
        }

        std::cout << sum << std::endl;
    }

    return 0;
}