#include <bits/stdc++.h>
using namespace std;
double distanceAB(double xa, double ya, double xb, double yb);
int main() {
  int wa[2001];
  int n;
  for (int i = 0; i <= 1000; i++)
    for (int j = 0; j <= 1000; j++) wa[i + j]++;
  while (cin >> n) {
    int ans = 0;
    for (int i = 0; i <= n; i++) {
      int sa = n - i;
      ans += wa[i] * wa[sa];
    }
    cout << ans << endl;
  }
  return 0;
}
double distanceAB(double xa, double ya, double xb, double yb) {
  return sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
}
