n = int(eval(input()))

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



MAX_N = max(A)+1

cnt = [0] * MAX_N 



for a in A:

  for i in range(a, MAX_N, a):

    if cnt[i] <= 2: cnt[i] += 1



ans = 0

for a in A:

  if cnt[a] == 1: ans += 1

print(ans)
def main():

  ## IMPORT MODULE

  #import sys



  #sys.setrecursionlimit(100000)

  #input=lambda :sys.stdin.readline().rstrip()



  #f_inf=float("inf")

  #MOD=10**9+7

  

  if 'get_ipython' in globals(): 

    ## SAMPLE INPUT

    n = 5

    A = [24, 11, 8, 3, 16]



  else:

    ##INPUT 

    n = int(eval(input()))

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



  ## SUBMITION CODES HERE

  MAX_N = max(A)+1

  cnt = [0] * MAX_N 



  for a in A:

    for i in range(a, MAX_N, a):

      if cnt[i] <= 2: cnt[i] += 1



  ans = 0

  for a in A:

    if cnt[a] == 1: ans += 1

  print(ans)

  

main()
n = int(eval(input()))
A = list(map(int, input().split()))
MAX_N = max(A) + 1
cnt = [0] * MAX_N
for a in A:
    for i in range(a, MAX_N, a):
        if cnt[i] <= 2:
            cnt[i] += 1
ans = 0
for a in A:
    if cnt[a] == 1:
        ans += 1
print(ans)

def main():
    ## IMPORT MODULE
    # import sys
    # sys.setrecursionlimit(100000)
    # input=lambda :sys.stdin.readline().rstrip()
    # f_inf=float("inf")
    # MOD=10**9+7
    if "get_ipython" in globals():
        ## SAMPLE INPUT
        n = 5
        A = [24, 11, 8, 3, 16]
    else:
        ##INPUT
        n = int(eval(input()))
        A = list(map(int, input().split()))
    ## SUBMITION CODES HERE
    MAX_N = max(A) + 1
    cnt = [0] * MAX_N
    for a in A:
        for i in range(a, MAX_N, a):
            if cnt[i] <= 2:
                cnt[i] += 1
    ans = 0
    for a in A:
        if cnt[a] == 1:
            ans += 1
    print(ans)


main()

-n = int(eval(input())) -A = list(map(int, input().split())) -MAX_N = max(A) + 1 -cnt = [0] * MAX_N -for a in A: -    for i in range(a, MAX_N, a): -        if cnt[i] <= 2: -            cnt[i] += 1 -ans = 0 -for a in A: -    if cnt[a] == 1: -        ans += 1 -print(ans) +def main(): +    ## IMPORT MODULE +    # import sys +    # sys.setrecursionlimit(100000) +    # input=lambda :sys.stdin.readline().rstrip() +    # f_inf=float("inf") +    # MOD=10**9+7 +    if "get_ipython" in globals(): +        ## SAMPLE INPUT +        n = 5 +        A = [24, 11, 8, 3, 16] +    else: +        ##INPUT +        n = int(eval(input())) +        A = list(map(int, input().split())) +    ## SUBMITION CODES HERE +    MAX_N = max(A) + 1 +    cnt = [0] * MAX_N +    for a in A: +        for i in range(a, MAX_N, a): +            if cnt[i] <= 2: +                cnt[i] += 1 +    ans = 0 +    for a in A: +        if cnt[a] == 1: +            ans += 1 +    print(ans) + + +main()