#include <bits/stdc++.h>
using namespace std;
template <class T>
int __builtin_popcount(T n) {
  return n ? 1 + __builtin_popcount(n & (n - 1)) : 0;
}
const int iINF = 2147483647;
const long long lINF = 9223372036854775807;
template <class T>
inline void dbg(T t) {
  cout << t << endl;
}
int npair[2020];
void make() {
  for (int i = (int)0; i < (int)1010; i++)
    for (int j = (int)0; j < (int)1010; j++) npair[i + j]++;
}
int main() {
  int n;
  memset(npair, 0, sizeof(npair));
  ;
  make();
  while (cin >> n) {
    int ans = 0;
    for (int i = (int)0; i < (int)min(2001, n + 1); i++) {
      int sub1, sub2;
      sub1 = npair[i];
      sub2 = npair[n - i];
      ans += sub1 * sub2;
    }
    cout << ans << endl;
  }
  return 0;
}
