#include <bits/stdc++.h>
int n;
int nummem[2002] = {0}, nummem2[2002] = {0};
int ans = 0;
int Bsearch(int x) {
  int r = 2000, l = 0, i;
  if (nummem2[x] != 0) {
    ans = ans + nummem2[x];
    return 0;
  }
  while (r - l >= 0) {
    i = (l + r) / 2;
    if (i == x) {
      ans = ans + nummem[i];
      nummem2[i] = nummem[i];
      return 0;
    } else if (i < x) {
      l = i + 1;
    } else {
      r = i;
    }
  }
  return 0;
}
int main() {
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      nummem[i + j]++;
    }
  }
  while (scanf("%d", &n) != -1) {
    ans = 0;
    for (int i = 0; i <= 1000; i++) {
      for (int j = 0; j <= 1000; j++) {
        if (n - i - j >= 0) Bsearch(n - i - j);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
