program ABC085B
    implicit none
    integer(8)::N,i,dim
    integer(8)::result=0
    integer(8),allocatable,dimension(:)::D
    read(5,*)N
    allocate(D(N))
    read(5,*)(D(i),i=1,N)

    D=iqsort(D)
    D=D(N:1:-1)

    do i=1,N
        if(i==1 .or. dim/=D(i))then
            dim=D(i)
            result=result+1
        end if
    end do

    print'(i0)',result

contains
    recursive function iqsort(ix) result(ires)
      integer(8), allocatable :: ires(:)
      integer(8), intent(in)  :: ix(:)
      integer :: k
      if (size(ix) <= 1) then 
        ires = ix
      else  
        k = ix(size(ix) / 2)
        ires = [iqsort(pack(ix, ix < k)), pack(ix, ix == k), iqsort(pack(ix, ix > k))] 
      end if
    end function iqsort
end program ABC085B