program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,i,j,l,ans=0
    integer(int32), allocatable:: a(:),divisor(:)

    read*, n
    allocate(a(n))
    read*, a(:)

    l = maxval(a)
    allocate(divisor(l))

    do i=1,n
        divisor(a(i))=divisor(a(i))+1
        if (divisor(a(i)) > 1) cycle
        j=2
        do while(a(i)*j <= l)
            divisor(a(i)*j)=divisor(a(i)*j)+1
            j=j+1
        end do
    end do

    do i=1,n
        if (divisor(a(i)) == 1) ans=ans+1
    end do
    print'(i0)', ans
end program main