#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, n;
long long ans;
int main() {
  while (cin >> n) {
    ans = 0;
    for (a = 0; a <= 1000 && a <= n; a++) {
      for (b = 0; a + b <= n && b <= 1000; b++) {
        if (n - a - b > 2000)
          break;
        else if (n - a - b > 1000)
          ans += 2000 - n + a + b + 1;
        else
          ans += n - a - b + 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
