var i,m,n,sum,j,k,cishu:longint;
a,b,c:array[1..1000000] of longint;
begin
assign(input,'highcard.in');reset(input);
assign(output,'highcard.out');rewrite(output);
readln(n);
for i:=1 to n do
begin
readln(m);
a[m]:=m;
end;
j:=0;k:=0;sum:=n;
for i:=1 to 2*n do
begin
if a[i]<>0 then begin inc(j); b[j]:=i; end;
end;
for i:=1 to 2*n do
begin
if a[i]=0 then begin inc(k); c[k]:=i end;
end;
j:=n+1;k:=n+1;
repeat
dec(j);dec(k);
if b[j]>c[k] then begin inc(k);dec(sum); end;
inc(cishu);
until cishu=n;
writeln(sum);
close(input);close(output);
end.