#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[4001] = {};
  for (int i = 0; i <= 1000; i++) {
    for (int j = 0; j <= 1000; j++) {
      a[i + j]++;
    }
  }
  for (int n; cin >> n;) {
    int r = 0;
    for (int i = 0; i <= 1000; i++) {
      for (int j = 0; i + j <= n; j++) {
        r += a[n - i - j];
      }
    }
    cout << r << endl;
  }
  return 0;
}
