#include <bits/stdc++.h>
int plass(int sum, int count_roop) {
  count_roop++;
  int x, count = 0;
  if ((5 - count_roop) * 1000 >= sum && count_roop <= 3) {
    x = sum - (4 - count_roop) * 1000;
    if (x < 0) x = 0;
    while (x <= sum) {
      if (x == sum)
        count++;
      else
        count += plass(sum - x, count_roop);
      x++;
    }
  } else if (count_roop == 4 && sum <= 1000)
    count++;
  return count;
}
int main(void) {
  int n;
  while (scanf("%d", &n) != EOF) {
    printf("%d\n", plass(n, 0));
  }
  return 0;
}
