{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';
 MaxN = 250; eps: Extended = 1E-14;
var i, j, k, l, m, n, u: Integer;
 x, y: array [1..MaxN] of Extended;
 next: array [0..MaxN] of Integer;
 b: array [0..MaxN] of Boolean;
 a, c, d, e, rs, s, t, xs: Extended;

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;

 b[0] := True;
 for i := 0 to MaxN do if b[i] then
  for j := i + 1 to MaxN do if b[j] then begin
   next[i] := j;
   break;
  end;
 m := 0;
 for i := 1 to MaxN do if b[i] then
  for j := i + 1 to MaxN do if b[j] then begin
   xs := i + j;
   a := 2.0 * xs;
   l := next[0];
   u := 0;
   for k := 1 to i - 1 do if b[k] then begin
    rs := sqr (j + k);
    c := sqr (xs) + rs - sqr (i + k);
    s := sqr (a);
    e := rs * s - sqr (c);
    d := sqrt (e);
    t := a / s;
    x[k] := t * c;
    y[k] := t * d;
    while sqr (x[l] - x[k]) + sqr (y[l] - y[k]) >= sqr (k + l) - eps do begin
     inc (u);
     l := next[l];
    end;
    inc (m, u);
   end;
  end;
 writeln (m);
{$IFDEF DMI} until seekeof; {$ENDIF}
END.
