const main = (input) => {
  input = input.trim().split('\n')
  const n = input[1].split(' ').map(Number).sort((a, b) => a - b)

  const biggest = n[n.length-1]
  const arr = new Array(parseInt(input[0], 10)+1).fill(false)

  let ans = 0

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

    for (let m=2; num * m <= biggest; m++) arr[num * 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'))