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