#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    long long int count = 0;
    if (n <= 3000) {
      for (int i = 0; i <= n; i++) count += ((i + 2) * (i + 1) / 2);
      cout << count << endl;
    } else {
      bool flag = false;
      for (int a = 0; a <= 1000; a++) {
        if (a > n && (n - a > 3000)) break;
        for (int b = 0; b <= 1000; b++) {
          if ((a + b) > n && (n - a - b > 2000)) 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;
}
