def main():

    numbers = int(eval(input()))

    array = [int(x) for x in input().split()]

    maximum = 1000001

    counter = [0] * maximum



    for x in array:

        if counter[x] != 0:

            counter[x] = 2

            continue

        else:

            for multiple in range(x, maximum, x):

                counter[multiple] += 1

    ans = 0

    for x in array:

        if counter[x] == 1:

            ans += 1

    print(ans)





if __name__ == '__main__':

    main()

def main():

    eval(input())

    array = sorted(int(x) for x in input().split())

    maximum = 1000001

    counter = [0] * maximum



    for x in array:

        if counter[x] != 0:

            counter[x] = 2

            continue

        else:

            for multiple in range(x, maximum, x):

                counter[multiple] += 1

    ans = 0

    for x in array:

        if counter[x] == 1:

            ans += 1

    print(ans)





if __name__ == '__main__':

    main()

def main():
    numbers = int(eval(input()))
    array = [int(x) for x in input().split()]
    maximum = 1000001
    counter = [0] * maximum
    for x in array:
        if counter[x] != 0:
            counter[x] = 2
            continue
        else:
            for multiple in range(x, maximum, x):
                counter[multiple] += 1
    ans = 0
    for x in array:
        if counter[x] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    eval(input())
    array = sorted(int(x) for x in input().split())
    maximum = 1000001
    counter = [0] * maximum
    for x in array:
        if counter[x] != 0:
            counter[x] = 2
            continue
        else:
            for multiple in range(x, maximum, x):
                counter[multiple] += 1
    ans = 0
    for x in array:
        if counter[x] == 1:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

-    numbers = int(eval(input())) -    array = [int(x) for x in input().split()] +    eval(input()) +    array = sorted(int(x) for x in input().split())