#include <bits/stdc++.h>
using namespace std;
const long long INF =
    sizeof(long long) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
const long long MOD = 1000000007;
const long double EPS = 1e-8;
using vi = vector<long long>;
using vvi = vector<vi>;
signed main() {
  long long n;
  while (cin >> n) {
    vi ab(2001, 0);
    for (auto a = 0; a < 1001; a++)
      for (auto b = 0; b < 1001; b++) {
        ab[a + b]++;
      }
    vi cd(2001, 0);
    for (auto c = 0; c < 1001; c++)
      for (auto d = 0; d < 1001; d++) {
        cd[c + d]++;
      }
    long long ans = 0;
    for (auto i = 0; i < 2001; i++) {
      if (0 <= n - i && n - i <= 2000) {
        ans += (ab[i] * cd[n - i]);
      }
    }
    cout << ans << endl;
  }
}
