#include <bits/stdc++.h>
int main(void) {
  int a, b, c, s, p, x, y, z;
  while (scanf("%d", &s) != EOF) {
    if (s > 4000) {
      printf("0\n");
    } else {
      p = 0;
      for (a = 0; a <= 1000; a++) {
        x = s - a;
        if (x < 0 || x > 3000) {
          continue;
        }
        for (b = 0; b <= 1000; b++) {
          y = s - a - b;
          if (y < 0 || y > 2000) {
            continue;
          }
          for (c = 0; c <= 1000; c++) {
            z = s - a - b - c;
            if (z < 0 || z > 1000) {
              continue;
            }
            p++;
          }
        }
      }
      printf("%d\n", p);
    }
  }
  return 0;
}
