#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    long long int count = 0;
    bool flag = false;
    for (int a = 0; a <= 1000; a++) {
      if (a > n) break;
      for (int b = 0; b <= 1000; b++) {
        if ((a + b) > n) break;
        for (int c = 0; c <= 1000; c++) {
          if ((a + b + c) > n) break;
          int kk = n - a - b - c;
          if (kk >= 0 && kk <= 1000) count++;
        }
      }
    }
    cout << count << endl;
  }
  return 0;
}
