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