N=eval(input())

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

M=A[-1]+1

B=[True]*M

c=0

x=0

for i in A:

  if B[i]==True:

    if i!=c:

      for j in range(i*2,M,i):

        B[j]=False

      x+=1

      c=i

    else:

      B[i]=False

      x-=1

print(x)
def main():

  N=eval(input())

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

  M=A[-1]+1

  B=[True]*M

  c=0

  x=0

  for i in A:

    if B[i]:

      if i!=c:

        for j in range(i*2,M,i):

          B[j]=False

        x+=1

        c=i

      else:

        B[i]=False

        x-=1

  print(x)

main()
N = eval(input())
A = sorted(map(int, input().split()))
M = A[-1] + 1
B = [True] * M
c = 0
x = 0
for i in A:
    if B[i] == True:
        if i != c:
            for j in range(i * 2, M, i):
                B[j] = False
            x += 1
            c = i
        else:
            B[i] = False
            x -= 1
print(x)

def main():
    N = eval(input())
    A = sorted(map(int, input().split()))
    M = A[-1] + 1
    B = [True] * M
    c = 0
    x = 0
    for i in A:
        if B[i]:
            if i != c:
                for j in range(i * 2, M, i):
                    B[j] = False
                x += 1
                c = i
            else:
                B[i] = False
                x -= 1
    print(x)


main()

-N = eval(input()) -A = sorted(map(int, input().split())) -M = A[-1] + 1 -B = [True] * M -c = 0 -x = 0 -for i in A: -    if B[i] == True: -        if i != c: -            for j in range(i * 2, M, i): -                B[j] = False -            x += 1 -            c = i -        else: -            B[i] = False -            x -= 1 -print(x) +def main(): +    N = eval(input()) +    A = sorted(map(int, input().split())) +    M = A[-1] + 1 +    B = [True] * M +    c = 0 +    x = 0 +    for i in A: +        if B[i]: +            if i != c: +                for j in range(i * 2, M, i): +                    B[j] = False +                x += 1 +                c = i +            else: +                B[i] = False +                x -= 1 +    print(x) + + +main()