#include <bits/stdc++.h>
int main(void) {
  int n;
  int a, b, c, d;
  int e, f, g;
  int ans;
  while (scanf("%d", &n) != EOF) {
    ans = 0;
    if (n > 1000)
      e = 1000;
    else
      e = n;
    for (d = e; 4 * d >= n; d--) {
      if (n - d > d)
        f = d;
      else
        f = n - d;
      for (c = f; 3 * c >= n - d; c--) {
        if (n - d - c > c)
          g = c;
        else
          g = n - d - c;
        for (b = g; 2 * b >= n - d - c; b--) {
          a = n - d - c - b;
          if (a == b && a == c && a == d)
            ans++;
          else if (a == b && a == c)
            ans += 4;
          else if (b == c && b == d)
            ans += 4;
          else if (a == b && c == d)
            ans += 6;
          else if (a == b || b == c || c == d)
            ans += 12;
          else
            ans += 24;
        }
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
