"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const N = parseInt(inputList[0].split(" ")[0]);
    const A = inputList[1].split(" ").map(ele => parseInt(ele));
    const Max = 1000001;

    let count = new Array(Max).fill(0);

    for (let i = 0; i < N; i++) {
        if (count[A[i]] != 0) {
            count[A[i]] = 2;
            continue;
        }

        for (let j = A[i]; j < Max; j += A[i]) {
            count[j]++;
        }
    }

    let result = 0;
    for (let i = 0; i < N; i++) {
        if (count[A[i]] == 1) {
            result++;
        }
    }

    console.log(result)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));