#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[2001] = {}, b[4001] = {};
  for (int i = 0; i <= 1000; i++)
    for (int j = 0; j <= 1000; j++) a[i + j]++;
  for (int i = 0; i <= 2000; i++)
    for (int j = 0; j <= 2000; j++) b[i + j] += a[i] * a[j];
  for (int n; cin >> n;) {
    assert(n);
    cout << b[n] << endl;
  }
  return 0;
}
