import sys



def solve(a,n):

    m = a[-1]+1

    ava = [0]*m

    for rep in a:

        ava[rep] += 1

        if ava[rep]:

            for i in range(2*rep,m,rep):

                ava[i] += 2

    return ava.count(1)

 

if __name__=='__main__':

    n = int(sys.stdin.readline().rstrip())

    a = list(map(int,sys.stdin.readline().rstrip().split()))

    a.sort()

    print((solve(a,n)))
import sys

def I(): return int(sys.stdin.readline().rstrip())

def IL(): return list(map(int,sys.stdin.readline().rstrip().split()))



def solve():

    m = a[-1]+1

    ava = [0]*m

    for rep in a:

        ava[rep] += 1

        if ava[rep]==1:

            for item in range(2*rep,m,rep):

                ava[item] += 2



    print((ava.count(1)))

    return



if __name__=='__main__':

    n = I()

    a = list(IL())

    a.sort()

    solve()
import sys


def solve(a, n):
    m = a[-1] + 1
    ava = [0] * m
    for rep in a:
        ava[rep] += 1
        if ava[rep]:
            for i in range(2 * rep, m, rep):
                ava[i] += 2
    return ava.count(1)


if __name__ == "__main__":
    n = int(sys.stdin.readline().rstrip())
    a = list(map(int, sys.stdin.readline().rstrip().split()))
    a.sort()
    print((solve(a, n)))

import sys


def I():
    return int(sys.stdin.readline().rstrip())


def IL():
    return list(map(int, sys.stdin.readline().rstrip().split()))


def solve():
    m = a[-1] + 1
    ava = [0] * m
    for rep in a:
        ava[rep] += 1
        if ava[rep] == 1:
            for item in range(2 * rep, m, rep):
                ava[item] += 2
    print((ava.count(1)))
    return


if __name__ == "__main__":
    n = I()
    a = list(IL())
    a.sort()
    solve()

-def solve(a, n): +def I(): +    return int(sys.stdin.readline().rstrip()) + + +def IL(): +    return list(map(int, sys.stdin.readline().rstrip().split())) + + +def solve(): -        if ava[rep]: -            for i in range(2 * rep, m, rep): -                ava[i] += 2 -    return ava.count(1) +        if ava[rep] == 1: +            for item in range(2 * rep, m, rep): +                ava[item] += 2 +    print((ava.count(1))) +    return -    n = int(sys.stdin.readline().rstrip()) -    a = list(map(int, sys.stdin.readline().rstrip().split())) +    n = I() +    a = list(IL()) -    print((solve(a, n))) +    solve()