let N = Int(readLine()!)!
let A = readLine()!.split(separator: " ").map { Int($0)! }.sorted()

var dp: [Bool] = .init(repeating: true, count: A.max()! + 1)
var count = 0
for i in 0..<A.count {
  if i > 0 && A[i] == A[i-1] {
    dp[A[i]] = false
    continue
  }
  var current = A[i] * 2
  while current <= A.last! {
    dp[current] = false
    current += A[i]
  }
}
for num in A {
  if dp[num] {
    count += 1
  }
}
print(count)