#include <bits/stdc++.h>
int n, a, b, r, t[3000] = {0};
int main() {
  for (a = 0; a <= 1000; a++)
    for (b = 0; b <= 1000; b++) t[a + b]++;
  for (; ~scanf("%d", &n);) {
    for (a = r = 0; a <= n; a++)
      if (n - a >= 0 && n - a <= n) r += t[n - a] * t[a];
    printf("%d\n", r);
  }
  return 0;
}
