#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n;
  int a_add_b[2001] = {0};
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      a_add_b[i + j]++;
    }
  }
  while (scanf("%d", &n) != EOF) {
    long long int ans = 0;
    for (int i = 0; i <= n; i++) {
      ans += a_add_b[i] * a_add_b[n - i];
    }
    std::cout << ans << std::endl;
  }
  return 0;
}
