"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    let A = arg[1].split(" ").map(n=>parseInt(n)).sort((a,b)=>a-b);
    
    const list = [...Array(1e6+1)].fill(0);
    
    for(let i=0; i<N; i++) {
        list[A[i]]++;
    }
    
    let answer = 0;
    
    for(let i=1; i<=1e6; i++) {
        if(list[i] === 0) continue;
        if(list[i] === 1) answer++;
        
        for(let j=i*2; j<=1e6; j+= i) {
            list[j] = 0;
        }
    }
    
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
