function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});
    var N = parseInt(input[0],10);
    var vec_A = input[1].map(e => parseInt(e, 10));   
    var vec_ans = [];
    var aryMax = function (a, b) {return Math.max(a, b);}
    var A_max = vec_A.reduce(aryMax);
    var n, j, tmp, l;
    var ans = 0;
    var searchVec_A = vec_A.reduce(function(m, a, i) {
  		m[a] = (m[a] || []).concat(i);
  		return m;
	}, {});

    var zeros = Array.from({ length: (A_max - 1) }, () => 0)
	if (vec_A.indexOf(1) !== -1) {
		 searchTable_ans = vec_A.reduce(function(m, a, i) {
					m[a] = (m[a] || []).concat(i);
					return m;
					}, {});
        if	(searchTable_ans['1'].length > 1){
        	ans = 0;
        } else {
			ans = 1;
		}
	} else {
		l = zeros.length;
		for (var i = 0; i < l; i++){
			if ((i + 2) in searchVec_A){
				if (zeros[i] != 1) {
					tmp = searchVec_A[String(i + 2)];
					if ((tmp != undefined) && tmp.length > 1){
						zeros[i] = 1;
					}
					n = 2;
					by_step:
					while (true){
						j = (i + 2) * n - 2;
                      	n ++;
						if (j >= zeros.length) break by_step;
						zeros[j] = 1;
					}
				}
			}		
		}
		l = vec_A.length;
		for (var i = 0; i < l; i++){
			if (!(zeros[vec_A[i]-2])) ans ++;
		}
	}						
	console.log(ans);
}   

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

 
	