#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000009;
signed main() {
  long long n;
  while (cin >> n) {
    map<long long, long long> A, B;
    for (long long i = 0; i < 1001; i++)
      for (long long j = 0; j < 1001; j++) A[i + j]++;
    for (long long i = 0; i < 1001; i++)
      for (long long j = 0; j < 1001; j++) B[i + j]++;
    long long ans = 0;
    for (long long i = 0; i < 2001; i++)
      if (n - i >= 0) ans += A[i] * B[n - i];
    cout << ans << endl;
  }
  return 0;
}
