#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-9;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int main() {
  int sum[2010];
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      sum[i + j]++;
    }
  }
  int n;
  while (scanf("%d", &n) != EOF) {
    long long ans = 0;
    for (int i = 0; i <= 2000; i++) {
      int a = n - i;
      if (a < 0) break;
      if (a > 2000) continue;
      ans += sum[i] * sum[a];
    }
    cout << ans << endl;
  }
  return 0;
}
