import java.util.Scanner

import scala.io.StdIn._
object Main extends App {

  def read(): (Int, Array[Int]) = {
    val sc: Scanner = new Scanner(System.in)
    val n = sc.nextInt()
    val arr = Array.fill(n)(sc.nextInt)
    sc.close()
    (n, arr)
  }

  def solve(): Int = {
    val (_, arr) = read()
    val sorted = arr.sorted
    val len = sorted.length
    val canDivideArr = Array.fill(len)(false)

    def markDivideNum(i: Int, nums: Array[Int], len: Int): Unit = {
      (i until len).foreach { index =>
        if(nums(index) % nums(i) == 0) canDivideArr(index) = true
      }
    }

    (0 until len).foldLeft(0) { case (acc, index) =>
      if(canDivideArr(index)) acc
      else {
        markDivideNum(index, sorted, len)
        if(len >= 2 && sorted.head == sorted(1)) acc else acc + 1
      }
    }
  }




  println(solve())

}
