function main(input) {
  const inputs =input.split('\n')
  const [N] = inputs[0].split(' ').map(Number)
  const A = inputs[1].split(' ').map(Number)
  const Asorted = A.sort((a, b) => { return a < b ? -1 : 1 })
  const Amap = Array.from(new Set(A))
  let mem = []

  // console.log(Asorted)
  let count = 0
  for (let i = 0; i <= N-1; i++) {
    const n = Asorted[i]
    if (mem[n] === 0) {
      mem[n] = 1
      count++
      continue
    }
    if (mem[n] === 1) continue
    mem[n] = 0
    for (let j = 1; j * n <= Asorted[N-1]; j++) {
      mem[j * n] = 0
    }
  }
  // console.log(mem)
  console.log(Amap.length - count)
}

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