import Foundation

func readInt() -> Int {
    return Int(readLine()!)!
}

func readInts(separator: String.Element = " ") -> [Int] {
    return readLine()!.split(separator: separator).map { Int($0)! }
}

func readTwoInts(separator: String.Element = " ") -> (a: Int, b: Int) {
    let ints = readLine()!.split(separator: separator).map { Int($0)! }
    return (a: ints[0], b: ints[1])
}

extension Int {

    // 約数
    var divisors: [Int] {
        var divisors: [Int] = []

        // √Nまで
        for number in 1...Int(sqrt(Double(self))) {
            if self % number == 0 {
                divisors.append(number)

                // N / aが割り切れる場合、N / aも約数
                if self.isMultiple(of: number), self / number != number {
                    divisors.append(self / number)
                }
            }
        }

//        divisors.sort(by: <)

        return divisors
    }
}

func mainD() {
    let N = readInt()
    let numbers = readInts()

    // 各数字があるかないかを表す配列
    var exists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)
    // 重複
    var doubleExists: [Bool] = .init(repeating: false, count: 1_000_000 + 1)

    for number in numbers {
        if exists[number] {
            doubleExists[number] = true
            continue
        }

        exists[number] = true
    }

    var count = 0
    for number in numbers {
        if doubleExists[number] {
            continue
        }

        var answer = true

        // 約数で自分以外
        var divisors = number.divisors
        if divisors.count > 1 {
            divisors.remove(at: 1)
        }

        for divisor in divisors {
            if exists[divisor] {
                answer = false
                break
            }
        }

        if answer {
            count += 1
        }
    }

    print(count)
}
mainD()