def solve(A):

    n = A[-1]

    is_nodiv = [True for _ in range(n+1)]



    pre = 0

    for a in A:

        if pre == a or not is_nodiv[a]:

            is_nodiv[a] = False

            continue



        for j in range(2*a, n+1, a):

            is_nodiv[j] = False

        

        pre = a

        

    return sum([is_nodiv[a] for a in A])







def main():

    N = int(eval(input()))

    A = list(map(int, input().split()))

    A.sort()

    ans = solve(A)

    print(ans)



if __name__ == "__main__":

    main()

def solve(A):

    n = A[-1]

    is_nodiv = [True] * (n+1)



    pre = 0

    for a in A:

        if pre == a or not is_nodiv[a]:

            is_nodiv[a] = False

            continue



        for j in range(2*a, n+1, a):

            is_nodiv[j] = False

        

        pre = a



    return sum([is_nodiv[a] for a in A])







def main():

    N = int(eval(input()))

    A = list(map(int, input().split()))

    A.sort()

    ans = solve(A)

    print(ans)



if __name__ == "__main__":

    main()

def solve(A):
    n = A[-1]
    is_nodiv = [True for _ in range(n + 1)]
    pre = 0
    for a in A:
        if pre == a or not is_nodiv[a]:
            is_nodiv[a] = False
            continue
        for j in range(2 * a, n + 1, a):
            is_nodiv[j] = False
        pre = a
    return sum([is_nodiv[a] for a in A])


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A.sort()
    ans = solve(A)
    print(ans)


if __name__ == "__main__":
    main()

def solve(A):
    n = A[-1]
    is_nodiv = [True] * (n + 1)
    pre = 0
    for a in A:
        if pre == a or not is_nodiv[a]:
            is_nodiv[a] = False
            continue
        for j in range(2 * a, n + 1, a):
            is_nodiv[j] = False
        pre = a
    return sum([is_nodiv[a] for a in A])


def main():
    N = int(eval(input()))
    A = list(map(int, input().split()))
    A.sort()
    ans = solve(A)
    print(ans)


if __name__ == "__main__":
    main()

-    is_nodiv = [True for _ in range(n + 1)] +    is_nodiv = [True] * (n + 1)