#include <bits/stdc++.h>
using namespace std;
const int IMAX = ((1 << 30) - 1) * 2 + 1;
const double EPS = 1e-10;
int main() {
  int n, ans;
  while (cin >> n) {
    ans = 0;
    int d;
    for (int i = 0; i <= 1000; i++) {
      for (int j = 0; j <= 1000; j++) {
        if (i + j > n || i + j + 2000 < n) break;
        for (int k = 0; k <= 1000; k++) {
          if (i + j + k + 1000 < n) break;
          d = n - i - j - k;
          if (d < 0) break;
          if (d <= 1000) ans++;
        }
      }
    }
    cout << ans << endl;
  }
}
