package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

func main() {
	sc := NewScanner()

	n := sc.ReadInt()
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = sc.ReadInt()
	}

	countInA := make([]int, 1_000_001)
	for _, ai := range a {
		countInA[ai]++
	}

	count := 0
	for _, ai := range a {
		if countInA[ai] > 1 {
			continue
		}

		factors := Factorize(ai)
		factors = factors[:len(factors)-1]
		continued := false
		for _, factor := range factors {
			if countInA[factor] > 0 {
				continued = true
				break
			}
		}
		if continued {
			continue
		}

		count++
	}

	fmt.Println(count)
}

func Factorize(n int) []int {
	primeCounts := PrimeFactorize(n)
	primeLen := len(primeCounts)
	if primeLen == 0 {
		return []int{1}
	}

	factorsLen := 1
	for _, primeCount := range primeCounts {
		factorsLen *= primeCount.Count + 1
	}

	factors := make([]int, 0, factorsLen)
	usePrimeCounts := make([]int, primeLen)
	lastPrimeCount := primeCounts[primeLen-1].Count
	for usePrimeCounts[primeLen-1] <= lastPrimeCount {
		factor := 1
		for i, primeCount := range primeCounts {
			factor *= Pow(primeCount.Value, usePrimeCounts[i])
		}
		factors = append(factors, factor)

		usePrimeCounts[0]++
		// carry
		for i := 0; i < primeLen-1; i++ {
			if usePrimeCounts[i] > primeCounts[i].Count {
				usePrimeCounts[i] = 0
				usePrimeCounts[i+1]++
			} else {
				break
			}
		}
	}

	return factors
}

func PrimeFactorize(n int) []ElemCount {
	primeCounts := make([]ElemCount, 0)

	addCountIfExist := func(i int) {
		count := 0
		for n%i == 0 {
			count++
			n /= i
		}
		if count > 0 {
			primeCounts = append(primeCounts, ElemCount{i, count})
		}
	}

	addCountIfExist(2)
	addCountIfExist(3)

	flag := true
	for i := 5; n > 1 && i*i <= n; {
		addCountIfExist(i)

		if flag {
			i += 2
		} else {
			i += 4
		}
		flag = !flag
	}

	if n > 1 {
		primeCounts = append(primeCounts, ElemCount{n, 1})
	}

	return primeCounts
}

type ElemCount struct {
	Value int
	Count int
}

// util
// *   math/simple

func Abs(x int) int {
	if x >= 0 {
		return x
	}
	return -x
}

func Min(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}
	min := values[0]
	for _, v := range values {
		if v < min {
			min = v
		}
	}
	return min
}

func Max(values ...int) int {
	if len(values) == 0 {
		panic("no values")
	}
	max := values[0]
	for _, v := range values {
		if v > max {
			max = v
		}
	}
	return max
}

func Pow(base int, exponent int) int {
	if exponent < 0 {
		panic(fmt.Sprintf("exponent: %d", exponent))
	}
	answer := 1
	for i := 0; i < exponent; i++ {
		answer *= base
	}
	return answer
}

func Ceil(divident, dividor int) int {
	quo := divident / dividor
	rem := divident % dividor

	if rem != 0 {
		if (divident > 0 && dividor > 0) ||
			(divident < 0 && dividor < 0) {
			return quo + 1
		}
	}
	return quo
}

// *   sortutil

func ReverseInts(a []int) {
	sort.Sort(sort.Reverse(sort.IntSlice(a)))
}

func ReverseStrings(a []string) {
	sort.Sort(sort.Reverse(sort.StringSlice(a)))
}

// *   io

type Scanner struct {
	bufScanner *bufio.Scanner
}

func NewScanner() *Scanner {
	bufSc := bufio.NewScanner(os.Stdin)
	bufSc.Split(bufio.ScanWords)
	bufSc.Buffer(nil, 100000000)
	return &Scanner{bufSc}
}

func (sc *Scanner) ReadString() string {
	bufSc := sc.bufScanner
	bufSc.Scan()
	return bufSc.Text()
}

func (sc *Scanner) ReadInt() int {
	bufSc := sc.bufScanner
	bufSc.Scan()
	text := bufSc.Text()

	num, err := strconv.Atoi(text)
	if err != nil {
		panic(err)
	}
	return num
}


Measured memory_bytes: 21372