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