program ZodisVyresni;

const Cn = 1000;
      PRF = 'ZOSZIAI.IN';
      RZF = 'ZODZIAI.OUT';
type  Aibe = set of char;
      Mas = array[1..Cn] of Aibe;

var A : Mas;  n : integer;
    F : text;
//--------------------------------------------
procedure Raides(var R : Aibe; zodis : string);
var i : integer;
begin
  R := [];
  for i := 1 to Length(zodis) do
    R := R + [Upcase(zodis[i])];
end;
//--------------------------------------------
var zodis : string;
    i, j : integer;
    gr : integer;
begin
  Assign(F, PRF);  Reset(F);
  ReadLn(F, n);
  for i := 1 to n do begin
    ReadLn(F, zodis);
    Raides(A[i], zodis);
  end;

  gr := 0;  i := 1;
  while i <= n do begin
     gr := gr + 1;
     j:= i + 1;
     while j <= n do
       if A[i] = A[j]
       then begin
               A[j] := A[n];
               n := n - 1;
            end
       else j := j + 1;
     i:= i + 1;
  end;
  
  Close(F);
  Assign(F, RZF);  Rewrite(F);
  WriteLn(F, gr);
  Close(F);
end.

	
