def main():

  N=int(eval(input()))

  D=[0]*(10**6+1)



  for a in sorted(map(int,input().split())):

    if D[a]==0:

      D[a]=1

      for i in range(2*a,10**6+1,a):

        D[i]=-1

    else:

      D[a]=-1



  print((D.count(1)))



main()

def main():

  N=int(eval(input()))

  D=[0]*(10**6+1)

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

  m=max(A)+1



  for a in A:

    if D[a]==0:

      D[a]=1

      for i in range(2*a,m,a):

        D[i]=-1

    else:

      D[a]=-1



  print((D.count(1)))



main()

def main():
    N = int(eval(input()))
    D = [0] * (10**6 + 1)
    for a in sorted(map(int, input().split())):
        if D[a] == 0:
            D[a] = 1
            for i in range(2 * a, 10**6 + 1, a):
                D[i] = -1
        else:
            D[a] = -1
    print((D.count(1)))


main()

def main():
    N = int(eval(input()))
    D = [0] * (10**6 + 1)
    A = sorted(map(int, input().split()))
    m = max(A) + 1
    for a in A:
        if D[a] == 0:
            D[a] = 1
            for i in range(2 * a, m, a):
                D[i] = -1
        else:
            D[a] = -1
    print((D.count(1)))


main()

-    for a in sorted(map(int, input().split())): +    A = sorted(map(int, input().split())) +    m = max(A) + 1 +    for a in A: -            for i in range(2 * a, 10**6 + 1, a): +            for i in range(2 * a, m, a):