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