program count;
var
a:array[1..100] of longint;
b:array[1..20000] of longint;
i,j,k,l,m,n:longint;
begin
assign(input,'countb.in');
reset(input);
assign(output,'countb.out');
rewrite(output);
readln(n);
for i:=1 to n do
read(a[i]);
for i:=1 to n-1 do
for j:=i+1 to n do
inc(b[a[i]+a[j]]);
m:=0;
for i:=1 to n do
if b[a[i]]>0 then inc(m);
writeln(m);
close(input);
close(output);
end.