#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int cnt = 0;
    for (int a = 0; a <= (min(1000, n)); a++) {
      for (int b = 0; b <= (min(1000, n)); b++) {
        for (int c = 0; c <= (min(1000, n)); c++) {
          if (n - a - b - c >= 0 && n - a - b - c <= 1000) {
            cnt++;
          }
        }
      }
    }
    cout << cnt << endl;
  }
}
