#include <bits/stdc++.h>
int main(void) {
  int n;
  int i, j;
  int p[4001];
  int ans;
  for (i = 0; i <= 1000; i++) {
    for (j = 0; j <= 1000; j++) {
      p[i + j]++;
    }
  }
  while (scanf("%d", &n) != EOF) {
    ans = 0;
    for (i = 0; i <= n; i++) {
      ans += (p[i] * p[n - i]);
    }
    printf("%d\n", ans);
  }
  return 0;
}
