#include <bits/stdc++.h>
int main() {
  int a, b, cnt = 0, n;
  int ab[2001] = {0};
  int abcd[4001] = {0};
  for (a = 0; a <= 1000; a++)
    for (b = 0; b <= 1000; b++) ab[a + b]++;
  for (a = 0; a <= 2000; a++)
    for (b = 0; b <= 2000; b++) abcd[a + b] += ab[a] * ab[b];
  scanf("%d", &n);
  printf("%d\n", abcd[n]);
  return 0;
}
