#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, count, array[2001];
  for (int a = 0; a <= 1000; a++)
    for (int b = 0; b <= 1000; b++) array[a + b]++;
  while (scanf("%d", &n) != EOF) {
    count = 0;
    for (int i = 0; i <= n; i++) {
      if (i > 2000) break;
      count += array[i] * array[n - i];
    }
    printf("%d\n", count);
  }
  return 0;
}
