#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int ans = 0;
    int x = 0;
    if (n > 3000) x = n - 3000;
    for (int i = x; i < 1001 && i <= n; i++) {
      int y = 0;
      if (n - i > 2000) y = n - i - 2000;
      for (int j = y; j < 1001 && i + j <= n; j++) {
        int z = 0;
        if (n - i - j > 1000) z = n - i - j - 1000;
        for (int k = z; k < 1001 && i + j + k <= n; k++) {
          ans++;
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}
