#include <algorithm>
#include <cstdio>

int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    int r = 0;
    for (int a = std::max(n, 1000); a >= n / 4; a--)
      for (int b = std::min(a, n - a); b >= (n - a) / 3; b--)
        for (int c = std::min(b, n - a - b); c >= (n - a - b + 1) / 2; c--) {
          int d = n - a - b - c;
          if (a == b && b == c && c == d)
            r += 1;
          else if (a == b && b == c || b == c && c == d)
            r += 4;
          else if (a == b && c == d)
            r += 6;
          else if (a == b || b == c || c == d)
            r += 12;
          else
            r += 24;
        }
    printf("%d\n", r);
  }
}