const main = (input) => {
  input = input.trim().split('\n')

  const n = input[1].split(' ').map(Number).sort((a, b) => a - b)
  const arr = new Array(parseInt(input[0], 10)+1).fill(false)
  const biggest = n[n.length-1]

  if (Array.from(new Set(n)).length === 1) return console.log(0)

  let ans = 0

  for (let i=0; i<n.length; i++) {
    if ((n[i-1] && n[i-1] === n[i]) || (n[i+1] && n[i+1] === n[i])) {}
    else if (!arr[n[i]]) ans++

    for (let m=2; n[i] * m <= biggest; m++) arr[n[i] * m] = true
  }

  return console.log(ans)
}

process.env.MYTEST
  ? (process.env.MYTEST === 'test' ? test() : main(require('fs').readFileSync('dev/stdin', 'utf8')))
  : main(require('fs').readFileSync('/dev/stdin', 'utf8'))
