Buggy python submission (verdict: Time Limit Exceeded):
from numba import jit

a=[]

@jit
def dp(a):
    aaset=set()
    while True:
        aaset.add(a[0])
        a2=[]
        for i,ai in enumerate(a,1):
            if ai%a[0]!=0:
                a2.append(ai)
        a=a2.copy()
        if len(a2)==0:
          break
    return aaset

n=int(input())
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aaset=dp(a)
aaset=aaset-dset    
print(len(aaset))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))

Buggy python submission (verdict: Runtime Error):
from numba import jit

n=int(input())
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aaset=set()

@jit
def dp():
    while True:
        aaset.add(a[0])
        a2=[]
        for i,ai in enumerate(a,1):
            if ai%a[0]!=0:
                a2.append(ai)
        a=a2.copy()
        if len(a2)==0:
          break
    return True

yn=dp()
aaset=aaset-dset    
print(len(aaset))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=[]

while True:
    aa.append(a[0])
    a2=[]
    for i in range(1,len(a)):
        if a[i]%a[0]!=0:
            a2.append(a[i])
#    a=a2.copy()
    if len(a2)==0:
        break

    aa.append(a2[0])
    a=[]
    for i in range(1,len(a2)):
        if a2[i]%a2[0]!=0:
            a.append(a2[i])
#    a=a2.copy()
    if len(a)==0:
        break

aaset=set(aa)
aaset=aaset-dset    
print(len(aaset))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=[]

while True:
    aa.append(a[0])
    a2=[]
    for i in range(1,len(a)):
        if a[i]%a[0]!=0:
            a2.append(a[i])
#    a=a2.copy()
    if len(a2)==0:
        break

    aa.append(a2[0])
    a=[]
    for i in range(1,len(a2)):
        if a2[i]%a[0]!=0:
            a.append(a2[i])
#    a=a2.copy()
    if len(a)==0:
        break

aaset=set(aa)
aaset=aaset-dset    
print(len(aaset))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
#aa=[]
aaset=set()
#icnt=0
while True:
    aaset.add(a[0])
#    aa.append(a[0])
    a2=[]
#    for i in range(1,len(a)):
    for i,ai in enumerate(a,1):
        if ai%a[0]!=0:
            a2.append(ai)
    a=a2.copy()
#    print(aa,a)     
    if len(a2)==0:
        break
#    icnt+=1
#    if icnt>10:break

#aaset=set(aa)
aaset=aaset-dset    
print(len(aaset))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=[]

icnt=0
while True:
    aa.append(a[0])
    a2=[]
    for i in range(1,len(a)):
        if a[i]%a[0]!=0:
            a2.append(a[i])
    a=a2.copy()
#    print(aa,a)     
    if len(a2)==0:
        break
    icnt+=1
#    if icnt>10:break

aaset=set(aa)
aaset=aaset-dset    
print(len(aaset))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))

a.sort()

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=[]

icnt=0
while True:
    aa.append(a[0])
    a2=[]
    for i in range(1,len(a)):
        if a[i]%a[0]!=0:
            a2.append(a[i])
    a=a2.copy()
#    print(aa,a)     
    if len(a2)==0:
        break
    icnt+=1
#    if icnt>10:break

aaset=set(aa)
aaset=aaset-dset    
print(len(aaset))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()
amax=max(a)
dp=[True]*(amax+1)

import collections
c = collections.Counter(a)

d=[]
for ck,cv in c.items():
    if cv>=2:
       d.append(ck) 
dset=set(d)
    
aa=set()
for ai in a:
    if dp[ai]:
        aa.add(ai)
        for aj in range(ai*2,amax+1,ai):
            dp[aj]=False

aa=aa-dset    
print(len(aa))