#include <bits/stdc++.h>
using namespace std;
int memo[1145];
int main() {
  for (int a = 0; a < (int)(1001); a++)
    for (int b = 0; b < (int)(1001); b++) memo[a + b]++;
  int n;
  while (~scanf("%d", &n)) {
    long long ans = 0;
    for (int c = 0; c <= 2000; c++) {
      if (n - c >= 0 and n - c <= 2000) ans += memo[c] * memo[n - c];
    }
    printf("%lld\n", ans);
  }
  return 0;
}
