#include <bits/stdc++.h>
using namespace std;
int x[4500], n;
int main() {
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      for (int k = 0; k <= 1000; k++) {
        x[i + j + k] += k;
      }
      for (int k = 1001; k <= 2000; k++) {
        x[i + j + k] += (2000 - k);
      }
    }
  }
  while (cin >> n) {
    cout << x[n] << endl;
  }
}
