program divisible
  implicit none
  integer :: n,i,j,count
  logical ::status
  integer,allocatable :: a(:)
  read(*,*) n
  allocate(a(n))
  read(*,*) a

  status = .true.
  count = 0
  
  do i = 1, n
     status = .true.
     do j = 1, n
        if (j==i) then
           cycle
        else
           if ( mod(a(i),a(j)) == 0 ) then
              status = .false.
              exit
           end if
        end if
     end do
     if (status) then
        count = count + 1
     end if
  end do
  
  write(*,'(i0)') count
  deallocate(a)
  stop
end program divisible
