import numpy as np





def main():

    n = int(eval(input()))

    A = [int(i) for i in input().split()]



    max_dp = max(A) + 1

    dp = np.zeros(max_dp, dtype="int32")





    for a in A:

        if dp[a] >= 2:

            continue

        dp[np.arange(a, max_dp, a)] += 2

        dp[a] -= 1



    print((np.sum(dp == 1)))





if __name__ == '__main__':

    main()



def main():

    n = int(eval(input()))

    A = [int(i) for i in input().split()]



    max_dp = max(A) + 1

    dp = [0] * max_dp





    for a in A:

        if dp[a] >= 2:

            continue

        dp[a] += 1

        for i in range(a << 1, max_dp, a):

            dp[i] += 2

    print((dp.count(1)))





if __name__ == '__main__':

    main()

import numpy as np


def main():
    n = int(eval(input()))
    A = [int(i) for i in input().split()]
    max_dp = max(A) + 1
    dp = np.zeros(max_dp, dtype="int32")
    for a in A:
        if dp[a] >= 2:
            continue
        dp[np.arange(a, max_dp, a)] += 2
        dp[a] -= 1
    print((np.sum(dp == 1)))


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    A = [int(i) for i in input().split()]
    max_dp = max(A) + 1
    dp = [0] * max_dp
    for a in A:
        if dp[a] >= 2:
            continue
        dp[a] += 1
        for i in range(a << 1, max_dp, a):
            dp[i] += 2
    print((dp.count(1)))


if __name__ == "__main__":
    main()

-import numpy as np - - -    dp = np.zeros(max_dp, dtype="int32") +    dp = [0] * max_dp -        dp[np.arange(a, max_dp, a)] += 2 -        dp[a] -= 1 -    print((np.sum(dp == 1))) +        dp[a] += 1 +        for i in range(a << 1, max_dp, a): +            dp[i] += 2 +    print((dp.count(1)))