if __name__ == "__main__":

    n = int(eval(input()))

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

    s_a = list(set(l_a))



    s_a.sort()



    dub_a = [0]*(max(s_a)+1)



    for i in l_a:

        dub_a[i] += 1



    dp = [1]*(max(s_a)+1)



    for i in s_a:

        if 2*i > len(dp)-1:

            pass

            '''

            elif dp[2*i] == 0:

            pass

            '''

        else:

            for j in range(2*i, len(dp), i):

                dp[j] = 0





    count = 0

    for i in s_a:

        if dp[i]==1 and dub_a[i]==1:

            count += 1

    print(count)

if __name__ == "__main__":

    n = int(eval(input()))

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

    s_a = list(set(l_a))



    s_a.sort()



    dub_a = [0]*(max(s_a)+1)



    for i in l_a:

        dub_a[i] += 1



    dp = [1]*(max(s_a)+1)



    for i in s_a:

        if dp[i] == 0:

            pass

        else:

            for j in range(2*i, len(dp), i):

                dp[j] = 0





    count = 0

    for i in s_a:

        if dp[i]==1 and dub_a[i]==1:

            count += 1

    print(count)
if __name__ == "__main__":
    n = int(eval(input()))
    l_a = list(map(int, input().split()))
    s_a = list(set(l_a))
    s_a.sort()
    dub_a = [0] * (max(s_a) + 1)
    for i in l_a:
        dub_a[i] += 1
    dp = [1] * (max(s_a) + 1)
    for i in s_a:
        if 2 * i > len(dp) - 1:
            pass
            """
            elif dp[2*i] == 0:
            pass
            """
        else:
            for j in range(2 * i, len(dp), i):
                dp[j] = 0
    count = 0
    for i in s_a:
        if dp[i] == 1 and dub_a[i] == 1:
            count += 1
    print(count)

if __name__ == "__main__":
    n = int(eval(input()))
    l_a = list(map(int, input().split()))
    s_a = list(set(l_a))
    s_a.sort()
    dub_a = [0] * (max(s_a) + 1)
    for i in l_a:
        dub_a[i] += 1
    dp = [1] * (max(s_a) + 1)
    for i in s_a:
        if dp[i] == 0:
            pass
        else:
            for j in range(2 * i, len(dp), i):
                dp[j] = 0
    count = 0
    for i in s_a:
        if dp[i] == 1 and dub_a[i] == 1:
            count += 1
    print(count)

-        if 2 * i > len(dp) - 1: +        if dp[i] == 0: -            """ -            elif dp[2*i] == 0: -            pass -            """