#include <bits/stdc++.h>
using namespace std;
int f(int n) { return min(n + 1, 2001 - n); }
int main() {
  int n;
  while (cin >> n) {
    int ans = 0;
    for (int i = 0; i < int(n + 1); ++i) {
      ans += f(i) * f(n - i);
    }
    cout << ans << endl;
  }
}
