import numpy as np

import sys

input = sys.stdin.readline





def main():

    n = int(eval(input()))

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



    max_dp = np.max(A) + 1

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



    for a in A:

        if dp[a] >= 2:

            continue

        fancy = np.arange(a, max_dp, a)

        dp[fancy] += 2

        dp[a] -= 1

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





if __name__ == '__main__':

    main()

import numpy as np

import sys

input = sys.stdin.readline





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()
import numpy as np
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

import numpy as np
import sys

input = sys.stdin.readline


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()

-    A = np.array([int(i) for i in input().split()]) -    max_dp = np.max(A) + 1 +    A = [int(i) for i in input().split()] +    max_dp = max(A) + 1 -        fancy = np.arange(a, max_dp, a) -        dp[fancy] += 2 +        dp[np.arange(a, max_dp, a)] += 2