#include <bits/stdc++.h>
int n;
int main(void) {
  while (~scanf("%d", &n)) {
    long long cnt = 0;
    for (int i = 0; i <= 1000; i++) {
      for (int j = 0; j <= 1000; j++) {
        if (i + j <= n) {
          int d = n - i - j;
          if (d <= 1000) cnt += (long long)(d + 1);
          if (d > 1000) cnt += (long long)(2000 - d + 1);
        }
      }
    }
    printf("%lld\n", cnt);
  }
  return 0;
}
