#include <iostream>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;


int main() {
    int n;
    while (cin >> n) {
        unsigned long cnt = 0;
        rep(a, 1001) {
            if (a > n) break;
            rep(b, 1001) {
                if (a + b > n) break;
                cnt += n - a - b + 1;
            }
        }
        cout << cnt << endl;
    }
}