#include <bits/stdc++.h>
int solve(int, int, int, unsigned[]);
int main() {
  FILE *fp = stdin;
  unsigned a, b, A[2001] = {0}, loopend, cnt;
  int n;
  for (a = 0; a <= 1000; a++)
    for (b = 0; b <= 1000; b++) A[a + b]++;
  while (fscanf(fp, "%d", &n)) {
    cnt = 0;
    loopend = n < 1000 ? n : 1000;
    for (a = 0; a <= 2 * loopend; a++)
      for (b = 0; b <= 2 * loopend; b++)
        if (a + b == n) cnt += A[a] * A[b];
    printf("%u\n", cnt);
  }
  return 0;
}
