#include <array>
#include <iostream>

using namespace std;

int main() {
  array<array<int, 4001>, 4> arr = {};

  for (int i = 0; i <= 1000; ++i)
    arr[0][i] = 1;

  for (int k = 1; k < 4; ++k)
    for (int i = 0; i <= 4000; ++i)
      for (int j = i; 0 <= j; --j)
        arr[k][i] += arr[0][j] * arr[k - 1][i - j];

  int n;
  while (cin >> n)
    cout << arr[3][n] << endl;
}
