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