#include <bits/stdc++.h>
int main(int argc, char *argv[]) {
  for (;;) {
    int a, b, c, r = 0;
    int n;
    if (scanf("%d", &n) != 1) break;
    for (a = 0; a <= 1000 && n - (a) >= 0; ++a)
      for (b = 0; b <= 1000 && n - (a + b) >= 0; ++b)
        for (c = 0; c <= 1000 && n - (a + b + c) >= 0; ++c)
          if (n - (a + b + c) <= 1000) ++r;
    printf("%d\n", r);
  }
  return (EXIT_SUCCESS);
}
