Pagini recente » Cod sursa (job #159213) | Cod sursa (job #766791) | Cod sursa (job #678410) | Cod sursa (job #1182807) | Cod sursa (job #129293)
Cod sursa(job #129293)
var n,i,j:longint;
aux:char;
v:array [1..36000] of string[20];
gasit:boolean;
begin
assign(input,'restante.in'); reset(input);
assign(output,'restante.out'); rewrite(output);
readln(n);
for i:=1 to n do begin
readln(v[i]);
repeat
gasit:=false;
for j:=1 to length(v[i])-1 do
if v[i][j]>v[i][j+1] then begin
aux:=v[i][j]; v[i][j]:=v[i][j+1]; v[i][j+1]:=aux; gasit:=true;
end;
until not gasit;
end;
for i:=1 to n do begin
gasit:=false;
for j:=i+1 to n do
if v[i]=v[j] then begin
v[j]:='!'; gasit:=true;
end;
if gasit then v[i]:='!';
end; j:=0;
for i:=1 to n do
if v[i]<>'!' then inc(j);
writeln(j);
close(input); close(output);
end.