'use strict';

function Main(input) {
    let tmp = input.trim().split('\n');
    const N = Number(tmp[0]);
    const A = tmp[1].split(' ').map((v) => Number(v)).sort((a, b) => a - b);

    const maxNum = A[N - 1];
    const resultArr = new Array(maxNum + 1).fill(0);
    for (const i of A) {
        resultArr[i] += 1;
    }
    
    for (let i = 0; i < maxNum + 1; i++) {
        if (resultArr[i] === 0) continue;
        for (let j = i * 2; j < maxNum + 1; j += i) {
            resultArr[j] = 0
        }
    }

    console.log(String(resultArr.filter(v => v === 1).length))
    return;
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));