#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s, i, a, b;
  while (cin >> n) {
    s = 0;
    i = n > 2000 ? n - 2000 : 0;
    for (i; i <= 2000; i++) {
      a = i < 1001 ? i + 1 : 2000 - i + 1;
      b = (n - i) < 1001 ? n - i + 1 : 2000 - (n - i) + 1;
      s = s + a * b;
    }
    cout << s << endl;
  }
  return 0;
}
