#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int AB[2001] = {0};
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      AB[i + j]++;
    }
  }
  while (cin >> n) {
    int ans = 0;
    for (int i = 0; i <= 2000; i++) {
      if (n - i >= 0) ans += AB[i] * AB[n - i];
    }
    cout << ans << endl;
  }
  return 0;
}
