const input = require("fs").readFileSync("/dev/stdin", "utf8")
 
;(input => {
    const rows = input.split('\n')
    const N = rows[0] - 0
 
    const A = rows[1].split(' ').map(Number)
    A.sort((a, b) => a - b)
 
    const mem = []
    let count = 0
 
    for (let i = 0; i < N; i ++) {
        if (mem[A[i]] === 1) {
            count--
            mem[A[i]] = 0
            continue
        } else if (mem[A[i]] === 0) {
            continue
        } else {
            mem[A[i]] = 1
        }
        for (let j = 2; A[i] * j <= A[N - 1]; j++) {
            mem[A[i] * j] = 0
        }
        count++
    }
    console.log(count)
 
})(input)