def main():

    n = int(eval(input()))

    a = tuple(map(int, input().split()))



    ans = 0

    mx = max(a) + 1

    dp = [0] * mx

    for i in a:

        for j in range(i, mx, i):

            dp[j] += 1

    for i in a:

        if dp[i] == 1:

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()
def main():

    _ = int(eval(input()))

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

    a.sort()

    a = tuple(a)



    ans = 0

    mx = max(a) + 1

    dp = [0] * mx

    for i in a:

        if dp[i] == 2:

            continue

        else:

            for j in range(i, mx, i):

                dp[j] += 1

    for i in a:

        if dp[i] == 1:

            ans += 1



    print(ans)





if __name__ == "__main__":

    main()
def main():
    n = int(eval(input()))
    a = tuple(map(int, input().split()))
    ans = 0
    mx = max(a) + 1
    dp = [0] * mx
    for i in a:
        for j in range(i, mx, i):
            dp[j] += 1
    for i in a:
        if dp[i] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    _ = int(eval(input()))
    a = list(map(int, input().split()))
    a.sort()
    a = tuple(a)
    ans = 0
    mx = max(a) + 1
    dp = [0] * mx
    for i in a:
        if dp[i] == 2:
            continue
        else:
            for j in range(i, mx, i):
                dp[j] += 1
    for i in a:
        if dp[i] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-    n = int(eval(input())) -    a = tuple(map(int, input().split())) +    _ = int(eval(input())) +    a = list(map(int, input().split())) +    a.sort() +    a = tuple(a) -        for j in range(i, mx, i): -            dp[j] += 1 +        if dp[i] == 2: +            continue +        else: +            for j in range(i, mx, i): +                dp[j] += 1