uses math;
const   fi='Cau2.inp';
        fo='Cau2.out';
        nm=1000000;
var     i,j,n,d:longint;
        a:array[1..nm]of longint;
procedure mofile;
begin
        assign(input,fi); reset(input);
        assign(output,fo); rewrite(output);
end;
procedure nhap;
begin
        readln(n);
        for i:=1 to n do read(a[i]);
end;
procedure qs(l,r: longint);
      var
         i,j,x,y: longint;
      begin
         i:=l; j:=r;
         x:=a[(l+r) div 2];
         repeat
           while a[i]<x do inc(i);
           while x<a[j] do dec(j);
           if not(i>j) then
             begin
                y:=a[i];
                a[i]:=a[j];
                a[j]:=y;
                inc(i); dec(j);
             end;
         until i>j;
         if l<j then qs(l,j);
         if i<r then qs(i,r);
      end;
function tknp(l,r,x:longint):longint;
var m:longint;
begin
        while l<=r do
                begin
                        m:=(l+r) div 2;
                        if a[m]=x then exit(m)
                        else if x<a[m] then r:=m-1
                        else l:=m+1;
                end;
        exit(0);
end;
procedure xuly;
begin
        qs(1,n);
        d:=0;
        for i:=1 to n do
                if a[i]>0 then
                if tknp(1,n,-a[i])>0 then inc(d);
        writeln(d);
end;
begin
        mofile;
        nhap;
        xuly;
end.
