// ABC170
function main(input) {
  var inputs = input.trim().split('\n');
  var N = parseInt(inputs[0], 10);
  var A = typeof(inputs[1]) !== 'undefined' ? inputs[1].split(' ').map(n => parseInt(n, 10)) : [];

  var full = [];
  for (var i = 0; i < 1000001; i++) {
    full.push(0);
  }

  for (var i = 0; i < N; i++) {
    if (full[A[i]] > 1) continue;

    shouldCont = true;
    loop = 1;
    while (true) {
      var temp = loop * A[i];
      if (temp > 1000001) {
        break;
      } else {
        if (full[temp] > 1) break;
        full[temp] += 1;
        loop += 1;
      }
    }
  }

  var counter = 0;
  for (var n = 0; n < N; n++) {
    if (full[A[n]] === 1) counter += 1;
  }

  console.log(counter);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));