class Scanner {
    private var stack = [String]()
    private var index = 0
    
    func peek() -> String {
        if stack.count == index {
            stack += readLine()!.split(separator: " ").map{ String($0) }
        }
        return stack[index]
    }
    
    func next() -> String {
        let value = peek()
        index += 1
        return value
    }
    
    func nextInt() -> Int {
        return Int(next())!
    }
    
    func nextDouble() -> Double {
        return Double(next())!
    }
}

var scanner = Scanner()

let N = scanner.nextInt()
let A = (0 ..< N).map { _ in scanner.nextInt() }

var count = [Int](repeating: 0, count: 1000001)

for x in A {
    count[x] += 1
}

var answer = 0
for i in 1 ... 1000000 {
    if count[i] == 1 {
        answer += 1
    }
    if count[i] > 0 {
        for j in stride(from: i, through: 1000000, by: i) {
            count[j] = 0
        }
    }
}

print(answer)
