{DEFINE DEBUG}
{DEFINE DMI}
{DEFINE DO0}
{$IFDEF DEBUG}
{$B-,I+,N+,O-,Q+,R+,S+}
{$ELSE}
{$B-,I-,N+,O+,Q-,R-,S-}
{$ENDIF}
{$APPTYPE CONSOLE}
Program JurySol;
uses SysUtils;
const TaskName = 'packing';
 MinN = 1; MaxN = 250; eps: Extended = 1E-14;
var i, j, k, l, m, n: Integer;
 b: array [1..MaxN] of Boolean;
 x1, y1, x2, y2: Extended;

function rho (x1, y1, x2, y2: Extended): Extended;
begin
 result := sqrt (sqr (x2 - x1) + sqr (y2 - y1));
end;

function place (var x, y: Extended;
 xone, yone, rone, xtwo, ytwo, rtwo: Extended): Boolean;
var x1, y1, a, b, c, d, e, s, t: Extended;
begin
 x1 := xtwo - xone;
 y1 := ytwo - yone;
 a := -2.0 * x1;
 b := -2.0 * y1;
 c := sqr (x1) + sqr (y1) + sqr (rone) - sqr (rtwo);
 s := sqr (a) + sqr (b);
 e := sqr (rone) * s - sqr (c);
 if e < 0.0 then begin
  if e > -eps then e := 0.0 else begin
   result := False;
   exit;
  end;
 end;
 d := sqrt (e);
 t := -1.0 / s;
 x := xone + t * (a * c - b * d);
 y := yone + t * (b * c + a * d);
 result := True;
end;

BEGIN
 reset (input, TaskName + '.in');
 rewrite (output, TaskName + '.out');
{$IFDEF DMI} repeat {$ENDIF}
 read (n);
 readln;
 fillchar (b, sizeof (b), 0);
 for i := 1 to n do begin
  read (k);
  b[k] := True;
 end;
 readln;

 m := 0;
 for i := MaxN downto 1 do if b[i] then
  for j := i - 1 downto 1 do if b[j] then
   for k := j - 1 downto 1 do if b[k] then begin
    if NOT place (x1, y1, -i, 0, i + k, j, 0, j + k) then
     assert (False);
    for l := k - 1 downto 1 do if b[l] then begin
     if NOT place (x2, y2, -i, 0, i + l, j, 0, j + l) then
      assert (False);
     if rho (x1, y1, x2, y2) >= k + l - eps then
      inc (m);
    end;
   end;
 writeln (m);
{$IFDEF DMI} until seekeof; {$ENDIF}
 assert (seekeof);
END.
