#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    long long int count = 0;
    if (n <= 1000) {
      for (int i = 0; i <= n; i++) count += ((i + 2) * (i + 1) / 2);
      cout << count << endl;
    } else {
      long long int count = 0;
      map<int, int> mm1;
      map<int, int> mm2;
      map<int, int>::iterator iter;
      for (int a = 0; a <= 1000; a++) {
        if ((n - a) > 3000 || (n < a)) continue;
        for (int b = 0; b <= 1000; b++) {
          if ((n - a - b) > 2000 || (n < a + b))
            continue;
          else
            mm1[a + b]++;
        }
      }
      for (int c = 0; c <= 1000; c++) {
        if ((n - c) > 3000) continue;
        for (int d = 0; d <= 1000; d++) {
          if ((n - c - d) < 0 || (n - c - d) > 2000)
            continue;
          else
            mm2[n - c - d]++;
        }
      }
      for (iter = mm1.begin(); iter != mm1.end(); ++iter) {
        if (mm2[iter->first] > 0) {
          count += (mm1[iter->first] * mm2[iter->first]);
        }
      }
      cout << count << endl;
    }
  }
  return 0;
}
