import java.util.Scanner

import scala.annotation.tailrec

object Main extends App {
  val sc = new Scanner(System.in)
  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)
}
