import sys



def Not_Divisible(n,p):

    maxp = max(p)

    dp = [[True,0] for _ in range(maxp+1)]

    for a in p:

        dp[a][1]+=1

        t =2

        while a*t <= maxp:

            if dp[a*t][0] == True :

                dp[a*t][0] = False

            t+=1

    k=0

    for d in p:

        if dp[d][1] == 1 and dp[d][0] == True:

            k+=1

    return k





def main():

    input = sys.stdin.readline

    

    inp1 = input().rstrip().split()

    n = int(inp1[0])



    inp2 = input().rstrip().split()

    p = tuple(map(int,inp2))

    print((Not_Divisible(n,p)))





if __name__ == '__main__':

    main()
import sys



def Not_Divisible(n,p):

    maxp = max(p)

    dp = [True for _ in range(maxp+1)]

    count =[0 for _ in range(maxp+1)]

    for a in p:

        count[a]+=1

        t =2

        while a*t <= maxp:

            if dp[a*t] == True :

                dp[a*t] = False

            t+=1

    k=0

    for d in p:

        if count[d] == 1 and dp[d] == True:

            k+=1

    return k





def main():

    input = sys.stdin.readline

    

    inp1 = input().rstrip().split()

    n = int(inp1[0])



    inp2 = input().rstrip().split()

    p = tuple(map(int,inp2))

    print((Not_Divisible(n,p)))





if __name__ == '__main__':

    main()
import sys


def Not_Divisible(n, p):
    maxp = max(p)
    dp = [[True, 0] for _ in range(maxp + 1)]
    for a in p:
        dp[a][1] += 1
        t = 2
        while a * t <= maxp:
            if dp[a * t][0] == True:
                dp[a * t][0] = False
            t += 1
    k = 0
    for d in p:
        if dp[d][1] == 1 and dp[d][0] == True:
            k += 1
    return k


def main():
    input = sys.stdin.readline
    inp1 = input().rstrip().split()
    n = int(inp1[0])
    inp2 = input().rstrip().split()
    p = tuple(map(int, inp2))
    print((Not_Divisible(n, p)))


if __name__ == "__main__":
    main()

import sys


def Not_Divisible(n, p):
    maxp = max(p)
    dp = [True for _ in range(maxp + 1)]
    count = [0 for _ in range(maxp + 1)]
    for a in p:
        count[a] += 1
        t = 2
        while a * t <= maxp:
            if dp[a * t] == True:
                dp[a * t] = False
            t += 1
    k = 0
    for d in p:
        if count[d] == 1 and dp[d] == True:
            k += 1
    return k


def main():
    input = sys.stdin.readline
    inp1 = input().rstrip().split()
    n = int(inp1[0])
    inp2 = input().rstrip().split()
    p = tuple(map(int, inp2))
    print((Not_Divisible(n, p)))


if __name__ == "__main__":
    main()

-    dp = [[True, 0] for _ in range(maxp + 1)] +    dp = [True for _ in range(maxp + 1)] +    count = [0 for _ in range(maxp + 1)] -        dp[a][1] += 1 +        count[a] += 1 -            if dp[a * t][0] == True: -                dp[a * t][0] = False +            if dp[a * t] == True: +                dp[a * t] = False -        if dp[d][1] == 1 and dp[d][0] == True: +        if count[d] == 1 and dp[d] == True: