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