Var a:array:[1..1000] of integer;
i,n,t,d:integer;
Begin
Write('n = ');readln(n);
For i:=1 to n do
Begin
Write('Nhap so thu ',i,' = ');readln(a[i]);
if (a[i] mod 2 = 0) and (a[i] mod 3 = 0) then
d:=d+1;
End;
Writeln('Co ',d,' so chia het cho 2 va 3');
For i:=1 to n do
If a[i] < a[i+1] then
begin
t:=a[i];
a[i]:=a[i+1];
a[i+1]:=t;
end;
write('Day sau khi sap xep la: ');
for i:=1 to n do
Write(a[i]:8);
Readln
End.