#include <bits/stdc++.h>
int main() {
  int n, a[2001], b[2001], result, i;
  while (scanf("%d", &n) != EOF) {
    if (n >= 2001) n = 4000 - n;
    for (i = 1; i <= 1001; i++) {
      a[i - 1] = i;
      a[2000 - i + 1] = i;
    }
    result = 0;
    for (i = 0; i < n; i++) result += a[i] * a[2000 - n + i] + 1;
    printf("%d\n", result + 1);
  }
  return 0;
}
