#include <bits/stdc++.h>
using namespace std;
signed main(void) {
  long long n;
  while (cin >> n) {
    long long a[2010] = {0};
    for (long long i = (long long)0; i < (long long)1001; ++i)
      for (long long j = (long long)0; j < (long long)1001; ++j) {
        a[i + j]++;
      }
    long long ret = 0;
    for (long long i = (long long)0; i < (long long)1001; ++i)
      for (long long j = (long long)0; j < (long long)1001; ++j) {
        if (i + j <= n) {
          ret += a[n - i - j];
        }
      }
    cout << ret << endl;
  }
  return 0;
}
