#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, d;
  unsigned long int sum;
  while (cin >> n) {
    sum = 0;
    for (a = 0; a <= 1000; ++a) {
      if (a > n) break;
      for (b = a; b <= 1000; ++b) {
        if (a + b > n) break;
        if (n - a - b > 2000) continue;
        for (c = b; c <= 1000; ++c) {
          if (a + b + c > n)
            break;
          else if (n - a - b - c <= 1000) {
            if (a != b && b != c && c != a)
              sum += 6;
            else if (a == b && b == c && c == a)
              sum += 1;
            else
              sum += 3;
          }
        }
      }
    }
    cout << sum << endl;
  }
  return 0;
}
