func readIntArray() -> [Int] {
    readLine()!.split(separator: " ").map({Int($0)!})
}

let N = Int(readLine()!)!
var A = readIntArray()
A.sort()

var multiple = Array.init(repeating: false, count: A.last! + 1)
var count: [Int:Int] = [:]

A.forEach({ i in
    if count[i] == nil && !multiple[i] {
        var j = 2
        while i * j <= A.last! {
            multiple[i * j] = true
            j += 1
        }
    }
    count[i] = (count[i] ?? 0) + 1
})

print(A.filter({count[$0] == 1 && !multiple[$0]}).count)
