import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner
  val N = sc.nextInt
  val As = Vector.fill(N)(sc.nextInt).sorted

  @tailrec def loop(done: Seq[Int], queue: Seq[Int], count: Int): Int = queue match {
    case first +: second +: rest =>
      if (done.exists(first % _ == 0)) {
        loop(done, second +: rest, count)
      } else if (second == first) {
        loop(first +: done, second +: rest, count)
      } else {
        loop(first +: done, second +: rest, count + 1)
      }
    case first +: rest =>
      if (done.exists(first % _ == 0)) {
        loop(done, rest, count)
      } else {
        loop(first +: done, rest, count + 1)
      }
    case _ => count
  }

  val ans = loop(Seq.empty[Int], As, 0)
  println(ans)
}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
object Scanner {
  private def isPrintableChar(c: Int) = 33 <= c && c <= 126
}

class Scanner {
  private[this] val in = System.in
  private[this] val buffer = new Array[Byte](1024)
  private[this] var ptr = 0
  private[this] var buflen = 0

  private def hasNextByte: Boolean =
    if (ptr < buflen) true
    else {
      ptr = 0
      buflen = in.read(buffer)
      buflen > 0
    }

  private def readByte: Byte =
    if (hasNextByte) {
      ptr += 1
      buffer(ptr - 1)
    } else -1

  def hasNext: Boolean = {
    while (hasNextByte && !Scanner.isPrintableChar(buffer(ptr))) ptr += 1
    hasNextByte
  }

  def next: String = {
    if (!hasNext) throw new NoSuchElementException
    val sb = new java.lang.StringBuilder
    var b = readByte
    while (Scanner.isPrintableChar(b)) {
      sb.appendCodePoint(b)
      b = readByte
    }
    sb.toString
  }

  def nextLong: Long = {
    if (!hasNext) throw new NoSuchElementException
    var n = 0
    var minus = false
    var b = readByte
    if (b == '-') {
      minus = true
      b = readByte
    }
    if (b < '0' || '9' < b) throw new NumberFormatException

    @tailrec def loop(): Long = {
      if ('0' <= b && b <= '9') {
        n *= 10
        n += b - '0'
        b = readByte
        loop()
      } else if (b == -1 || !Scanner.isPrintableChar(b)) {
        if (minus) -n else n
      } else throw new NumberFormatException
    }

    loop()
  }

  def nextInt: Int = {
    val nl = nextLong
    if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException
    nl.toInt
  }

  def nextDouble: Double = next.toDouble
}