program test_number; {$APPTYPE CONSOLE} uses SysUtils,math; var a,b:array[1..1000000] of integer; t,i,n,k,j:integer; begin for i:=1 to 10 do begin {assign(output, 'circle'+inttostr(i)+'.in'); rewrite(output); randomize; if i<=2 then n:=random(10)+1 else if i<=4 then n:=random(90)+10 else if i<=6 then n:=random(9000)+1000 else if i<=8 then n:=random(90000)+10000 else if i<10 then n:=random(900000)+100000 ELSE if i=10 then n:=1000000; writeln(n); for j:=1 to n-1 do write(random(n)+1, ' '); writeln(random(n)+1); close(output); } assign(input, 'circle'+inttostr(i)+'.in'); reset(input); assign(output, 'circle'+inttostr(i)+'.out'); rewrite(output); for j:=1 to 1000 do b[j]:=0; readln(n); for j:=1 to n do begin read(t);b[t]:=1; end; k:=0; for j:=1 to n do begin //write(b[j],' '); k:=k+b[j]; end; //writeln(k); k:=0; for j:=1 to n do begin if ((b[j]>0)and(j mod 2=1))then k:=k+1; if ((b[j]>0) and (j mod 2=0)and (b[j div 2]=0)) then begin k:=k+1;end; if ((b[j]>0) and (j mod 2=0)and (b[j div 2]>0)) then b[j]:=0; end; writeln(k); close(input); close(output); end; end.