#include <iostream>

using namespace std;

int main()
{
    int n;

    while (cin >> n) {
        int ans = 0;

        for (int a = 0; a <= 1000; a++) {
            if (a > n)
                break;
            for (int b = 0; b <= 1000; b++) {
                if (a + b > n)
                    break;
                for (int c = 0; c <= 1000; c++) {
                    if (a + b + c <= n && a + b + c + 1000 >= n) 
                        ans++;
                }
            }
        }
        cout << ans << endl;
    }

    return 0;
}