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 ans = 0;
    var vec_ans = [];
    var X, groupL, groupH, searchTableL, searchTableH, searchTable_ans;
    var aryMax = function (a, b) {return Math.max(a, b);}
	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 {
		while (true){
			if (vec_A.length == 1) {
				vec_ans.push(vec_A[0]);
				break;
			}  else if (vec_A.length < 1){
				break;
			} else {    
				X = Math.sqrt(vec_A.reduce(aryMax));
				groupL = vec_A.filter( function( value ) {
					return value <= X;
					})
				searchTableL = groupL.reduce(function(m, a, i) {
					m[a] = (m[a] || []).concat(i);
					return m;
					}, {});
				groupH = vec_A.filter( function( value ) {
					return value > X;
					})
				searchTableH = groupH.reduce(function(m, a, i) {
					m[a] = (m[a] || []).concat(i);
					return m;
					}, {});
				for (var i = 0; i < groupH.length; i++){
					divisionCheck_loop:	
					for (var j = 2; j <= X; j++){
						if (groupH[i] % j == 0){
							if((j in searchTableL) || ((groupH[i]/j) in searchTableH)) break divisionCheck_loop;
						}
						if (j == Math.floor(X)) vec_ans.push(groupH[i]);
					}
				}
			}
				vec_A = groupL.slice();
		}
	}
  searchTable_ans = vec_ans.reduce(function(m, a, i) {
					m[a] = (m[a] || []).concat(i);
					return m;
					}, {});
	for (var i = 0; i < vec_ans.length; i++){
      var a = searchTable_ans[String(vec_ans[i])];
      	 if (a.length == 1) ans++;
	}
	console.log(ans);
}   

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