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