   program abc164c
      implicit none
      integer::n
      character(10),allocatable::s1(:),s2(:) !元の配列、ソート後の配列
      integer::i,j,count
      integer,parameter::p=100

         read *, n
         allocate(s1(n),s2(n))
         do i=1,n
            read *,s1(i)
         end do

         do i=1,p
            call sort_quick(n, s1, s2)
         end do

         count=1
         do i=1,n-1
            if (s2(i)==s2(i+1)) cycle
            count=count+1
         end do

         print *, count
         stop



   contains
      subroutine sort_quick(num, a, b)
         implicit none
         integer, intent(in)  :: num
         character(10), intent(in):: a(num)
         character(10), intent(out) :: b(num)
         integer:: i, j
         character(10)::w

         ! 配列コピー
            b(:)=a(:)

         ! ソート処理
            call quick(1, num, num, b)
      end subroutine sort_quick

      recursive subroutine quick(left, right, num, a)
         implicit none
         integer, intent(in)    :: left, right, num
         character(10), intent(inout) :: a(num)
         integer :: i, j
         character(10)::s, w

            if (left >= right) return

         ! 最左項を軸に. 軸より小さいグループ. 軸より大きいグループ.
            s = a(left)
            i = left
            j = right + 1
            do
               i = i + 1
               do while (a(i) < s)
                  i = i + 1
               end do
               j = j - 1
               do while (a(j) > s)
                  j = j - 1
               end do
               if (i >= j) exit
           ! スワップ
               w    = a(i)
               a(i) = a(j)
               a(j) = w
            end do

        ! 軸を正しい位置に挿入
            a(left) = a(j)
            a(j)    = s
            call quick(left,  j - 1, num, a)  ! 左部分列に対する再帰呼び出し
            call quick(j + 1, right, num, a)  ! 右部分列に対する再帰呼び出し
      end subroutine quick

   end program abc164c