#include <bits/stdc++.h>
int n, m;
int N(int x) { return (x + 1) * (x + 2) * (x + 3) / 6; }
int main() {
  while (~scanf("%d", &n)) {
    if (n > 2000) n = 4000 - n;
    if (n < 1001)
      printf("%d\n", N(n));
    else {
      m = n - 1000;
      printf("%d\n", N(n) - (N(m) - m + 1) / 2);
    }
  }
  return 0;
}
