#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int c[2002] = {0};
  for (int i = 0; i < 1001; i++)
    for (int j = 0; j < 1001; j++) c[i + j]++;
  while (cin >> n) {
    int an = 0;
    for (int i = 0; i <= n; i++) an += c[i] * c[n - i];
    cout << an << endl;
  }
}
