#include <bits/stdc++.h>
int main(void) {
  int n, ans[50], i = 0, j;
  while (scanf("%d", &n) != EOF) {
    if (n <= 1000) {
      ans[i] = (n + 3) * (n + 2) * (n + 1) / 6;
    } else if (n <= 2000) {
      ans[i] = (n + 3) * (n + 2) * (n + 1) / 6 -
               (n - 997) * (n - 998) * (n - 999) / 6;
    } else if (n < 3000) {
      ans[i] = (4003 - n) * (4002 - n) * (4001 - n) / 6 -
               (3003 - n) * (3002 - n) * (3001 - n) / 6;
    } else {
      ans[i] = (4003 - n) * (4002 - n) * (4001 - n) / 6;
    }
    i++;
  }
  for (j = 0; j < i; j++) printf("%d\n", ans[j]);
  return 0;
}
