program sample
	implicit none
    integer(8) :: N,i,j,count
    integer(8),allocatable :: A(:)
    
    read(*,*) N
    
    allocate(A(N))
    read(*,*) A
    
    count=0
    
    do i=1,N-1
    	do j=i+1,N
        	if (mod(A(i),A(j)) ==0) then
            	count = count +1
                exit
            end if
            !write(*,*) count
        end do
	end do
    
    do i=2,N
    	do j=1,i-1
        	!write(*,*) count
        	if (mod(A(i),A(j)) ==0) then
            	count = count +1
                exit
            end if
        end do
	end do
    
    write(*,*) N-count
    
	deallocate(A)
    stop
end program sample