import Foundation

let N = Int(readLine()!)!
let values = readLine()!.components(separatedBy: " ").map({Int($0)!})

func later_pattern() {
    var count = 0
    for i in 0 ..< N {
        var ok = true
        for j in 0 ..< N {
            if i == j { continue }
            if values[i] % values[j] == 0 {
                ok = false
                continue
            }
        }
        if ok {
            count += 1
        }
    }

    print(count)
}

func fast_pattern() {
    // TODO: 同じ数が複数あるときにそれを含めないようにする必要がある
    let sorted = values.sorted()
    var dp = [Bool](repeating: true, count: sorted.count)
    let end = Int(sqrt(Double(N)))
    for i in 0 ..< end {
        if dp[i] == false {continue}
        for j in i+1 ..< sorted.count {
            if sorted[j] == sorted[i] {
                // 同じ数が含まれる場合は自分自身も対象外
                dp[i] = false
            }
            if sorted[j] % sorted[i] == 0 {
                dp[j] = false
            }
        }
    }

    //print(dp)
    print(dp.filter{$0 == true}.count)
}

fast_pattern()

