let n = Int(readLine()!)!
var aArray = readLine()!.split(separator: " ").map{Int($0)!}.sorted()
var noDuplicate = Set<Int>()
var duplicate = Set<Int>()
for item in aArray {
    if noDuplicate.contains(item) {
        duplicate.insert(item)
        continue
    } else {
        noDuplicate.insert(item)
    }
}
let noDuplicateArray = [Int](noDuplicate).sorted()
let num = noDuplicateArray.count
var dpTable = [Bool](repeating: true, count: 200000)
// dp[i] =true のとき, i より小さい i の約 数が A に存在しないことを表します.

var count = 0
var max = noDuplicateArray.last!
for item in noDuplicateArray {
    if dpTable[item-1] == true {
        if duplicate.contains(item) {
            dpTable[item-1] = false
        } else {
            count += 1
        }
        var i = 2
        while i*item <= max {
            dpTable[i*item-1] = false
            i += 1
        }
    }
}
print(count)
