import java.util.Scanner

import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer

object Main {

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)

    val n = sc.nextInt()
    val a = Array.fill(n)(sc.nextInt())
    val aset = a.toSet

    if (aset.contains(1)) {
      println(0)
    } else {
      var cnt = 0
      aset.foreach { i =>
        val idiv = divisors(i)
        if (!idiv.exists(aset.contains)) cnt += 1
      }

      val arr = ArrayBuffer.fill(aset.max)(0)
      a.foreach { i =>
        val k = arr(i - 1)
        if (k == 1) {
          cnt -= 1
          arr(i - 1) += 1
        } else {
          arr(i - 1) += 1
        }
      }

      println(cnt)

    }
  }

  def divisors(n: Int): ArrayBuffer[Int] = {
    val ld = mutable.ArrayBuffer.empty[Int]
    val ud = mutable.ArrayBuffer.empty[Int]
    var i = 2
    while (i * i <= n) {
      if (n % i == 0) {
        ld += i
        if (i != n / i) {
          ud += n / i
        }
      }
      i += 1
    }
    ld ++ ud
  }


}
