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