#include <iostream>

using namespace std;

int main() {
    int n;
    int dp[4001];
    while (true) {
        cin >> n;
        if (cin.eof()) {
            return 0;
        }
        for (int i=0; i<=n; i++) {
            dp[i] = 0;
        }
        for (int i=0; i<4; i++) {
            for (int j=n; j>=0; j--) {
                for (int k=1; k<=1000 && j-k >= 0; k--) {
                    dp[j] += dp[j-k]+1;
                }
            }
        }
        cout << dp[n] << endl;
    }
}