let N = Int(readLine()!)!
let A = readLine()!.split(separator: " ").map { Int($0)! }
var hashTable: [Int: Int] = [:]
for a in A {
  hashTable[a, default: 0] += 1
}
var count = 0

for num in A {
  if hashTable[num]! > 1 {
    continue
  }
  var i = 1
  var hashSet: Set<Int> = []
  var flag = true
  while i <= num / 2 {
    if num % i == 0 && hashTable[i] != nil {
      flag = false
      break
    }
    i += 1
  }
  if flag {
    count += 1
  }
}
print(count)