      MODULE strQsortMod
      implicit none
      
      integer(16),parameter,private :: charLen = 10
      
      contains
      
      recursive function qSort( s ) result( r )
        implicit none
        character(charLen),intent(in) :: s(:)
        character(charLen),allocatable :: r(:)
        character(charLen) :: sample(3),buffer
        integer(16) :: len,i,j
        
        len = size( s(:) )
        if( len>1 )then
          !select pivot
          sample(1) = s(1)
          sample(2) = s(len/2)
          sample(3) = s(len)
          do i = 1,2
            do j = 2,3
              if( sample(i)>sample(j) )then
                buffer = sample(i)
                sample(i) = sample(j)
                sample(i) = buffer
              end if
            end do
          end do
          
          
          r = [ qSort( pack(s(:),s(:)< sample(2)) ), &
                       pack(s(:),s(:)==sample(2))  , &
                qSort( pack(s(:),s(:)> sample(2)) ) ]
          else
            r = s
          end if
        end function
      
      
      end MODULE
      
      
      PROGRAM gacha
      use strQsortMod
      IMPLICIT NONE
      integer(16) :: n,i ,ans = 1
      character(10),allocatable :: s(:)
      character(10) :: buffer
      
      read*,n
      allocate(s(n))
      do i = 1,n
        read*,s(i)(:)
      end do
      
      s = qSort( s )
      
      
      buffer = s(1)
      do i = 2,n
        if( buffer/=s(i) )then
          ans = ans + 1
          buffer = s(i)
        end if
      end do
      
      print*,ans
      
      END PROGRAM