program not_divisible
  implicit none
  integer :: n, a(200000) = 0, c(1000000) = 0, m = 0, i, j
  read(*,*) n
  read(*,*) a(1:n)
  do i = 1, n
    c(a(i)) = c(a(i))+1
  end do
  select case(c(1))
  case(1)
    write(*,'(i0)') 1
    stop
  case(2:)
    write(*,'(i0)') 0
    stop
  end select
  do i = 1, n
    if (c(a(i)) > 1) cycle
    do j = 2, a(i)
      if (j*j > a(i)) exit
      if (mod(a(i),j) /= 0) cycle
      if (c(j) > 0 .or. c(a(i)/j) > 0) goto 100
    end do
    m = m+1
  100 end do
  write(*,'(i0)') m
end program not_divisible