#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
const int MOD = (int)1e9 + 7, INF = (1 << 27);
const ll INFLL = (1LL << 55);
template <typename T>
void dbg(T x) {
  cout << x << "\n";
}
template <typename T, typename U>
static void chmin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
static void chmax(T &x, U y) {
  if (x < y) x = y;
}
int main() {
  int n;
  while (cin >> n) {
    static int cnt1[2018], cnt2[2018];
    memset(cnt1, 0, sizeof(cnt1));
    memset(cnt2, 0, sizeof(cnt2));
    for (int(c) = (0); c < (int)(1001); c++)
      for (int(d) = (0); d < (int)(1001); d++)
        if (n - c - d >= 0) {
          cnt1[n - c - d]++;
        }
    for (int(a) = (0); a < (int)(1001); a++)
      for (int(b) = (0); b < (int)(1001); b++) {
        int x = a + b;
        cnt2[x]++;
      }
    ll ans = 0;
    for (int(i) = (0); i < (int)(2018); i++) ans += cnt1[i] * cnt2[i];
    cout << ans << "\n";
  }
  return 0;
}
