var
i,k,m,c,b:longint;
a:array[0..100000]of longint;
q:array[0..100000]of boolean;
begin
assign(input,'countb.in');
assign(output,'countb.out');
reset(input);
rewrite(output);
read(m);
for i:=1 to m do read(a[i]);
for i:=1 to m-1 do
for k:=i+1 to m do begin
c:=a[i]+a[k];
q[c]:=true;
end;
for i:= 1to 100000 do if q[a[i]] then inc(b);
write(b);
close(input);
close(output);
end.