program main
      implicit none
      integer(4) :: n, i, j
      character(10), allocatable :: s(:)
      integer(4), allocatable :: num1(:), num2(:)
      integer(4) :: cnt

      read *, n
      allocate( s(n) )
      allocate( num1(n) )
      allocate( num2(n) )
      do i = 1, n
        read *, s(i)
        num1(i) = i
        num2(i) = len(trim(s(i)))
      end do
      call quicksort1( num2, 1, n, num1 )

      cnt = 0
      do i = 1, n
        do j = i+1, n
          if ( num2(j) == 0 ) cycle
          if ( num2(i) == num2(j) ) then
            if ( s(num1(i)) == s(num1(j)) ) then
              cnt = cnt + 1
              num2(j) = 0
            else
            end if
          else
            exit
          end if
        end do
      end do

      print *, n - cnt

end program main

recursive subroutine quicksort1(a, first, last, b)
  implicit none
  integer(4),intent(inout)::a(*)
  integer(4),intent(inout)::b(*)
  integer,intent(in)::first,last
  integer(4)::x
  integer(4) ::t
  integer::i,j

  x = a((first+last)/2)
  i = first
  j = last

  do
     do while (a(i) < x)
        i=i+1
     end do
     do while (x < a(j))
        j=j-1
     end do
     if (i >= j) exit
     t = a(i)
     a(i) = a(j)
     a(j) = t
     t = b(i)
     b(i) = b(j)
     b(j) = t
     i=i+1
     j=j-1
  end do
  if (first < i-1) call quicksort1(a, first, i-1, b)
  if (j+1 < last)  call quicksort1(a, j+1, last, b)

  return
end subroutine quicksort1
