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

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