#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double eps = 1e-10;
const double pi = acos(-1.0);
const long long inf = 1LL << 62;
int main(void) {
  int n;
  vector<int> list;
  for (int c = (0); c < (1001); ++c)
    for (int d = (0); d < (1001); ++d) {
      int x = c + d;
      list.push_back(x);
    }
  sort(list.begin(), list.end());
  while (cin >> n) {
    if (cin.eof()) break;
    int ans = 0;
    for (int a = (0); a < (1001); ++a) {
      if (a > n) continue;
      for (int b = (0); b < (1001); ++b) {
        if (a + b > n) continue;
        int x = n - a - b;
        ans += upper_bound(list.begin(), list.end(), x) -
               lower_bound(list.begin(), list.end(), x);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
