Buggy python submission (verdict: Time Limit Exceeded):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())
A = []
for a in map(int,input().split()):
    A.append(a)
A.sort()
c = 0
lenA = len(A)
for i in range(lenA):
    Ai = A[i]
    if i < lenA - 1:
        if Ai == A[i + 1]:
            continue
    Ad = make_divisors(Ai)
    sAd = set(Ad)
    l = A[:i]
    sl = set(l)
    s = sl - sAd
    if len(sl) == len(s):
        c += 1
print(c)

Fixed submission:
N = int(input())
c=[0]*8**7
for a in input().split():
    c[int(a)] += 1
i=r=0
for t in c:
    if t:
        c[::i]=[0]*-(-8**7//i)
    i+=1
    r+=t==1
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lstA = []
dctA = {}
for n in input().split():
  i = int(n)
  lstA.append(i)
  dctA[i] = 0
lstA.sort()
for i in range(N):
  Ai = lstA[i]
  if dctA[Ai] > 0:
    continue
  for j in range(i + 1,N):
    Aj = lstA[j]
    if dctA[Aj] > 0:
      continue
    m = Aj % Ai
    if m == 0:
      dctA[Aj] += 1
c = 0
for a in dctA:
  if dctA[a] == 0:
    c += 1
print(c)
  
  

Fixed submission:
N = int(input())
c=[0]*8**7
for a in input().split():
    c[int(a)] += 1
i=r=0
for t in c:
    if t:
        c[::i]=[0]*-(-8**7//i)
    i+=1
    r+=t==1
print(r)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = {}
for n in input().split():
  i = int(n)
  A[i] = 0
A.sort()

Fixed submission:
N = int(input())
c=[0]*8**7
for a in input().split():
    c[int(a)] += 1
i=r=0
for t in c:
    if t:
        c[::i]=[0]*-(-8**7//i)
    i+=1
    r+=t==1
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
c = 0
for n in input().split():
  i = int(n)
  A.append(i)
A.sort()
for i in range(N):
  Ai = A[i]
  if i != N - 1:
    if Ai == A[i + 1]:
      continue
  flg = True
  for j in range(i):
    Aj = A[j]
    if Ai % Aj == 0:
      flg = False
      break
  if flg:
    c += 1
print(c)
    
    

Fixed submission:
N = int(input())
c=[0]*8**7
for a in input().split():
    c[int(a)] += 1
i=r=0
for t in c:
    if t:
        c[::i]=[0]*-(-8**7//i)
    i+=1
    r+=t==1
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
c = 0
for n in input().split():
  i = int(n)
  A.append(i)
for i in range(N):
  Ai = A[i]
  flg = True
  for j in range(N):
    if i == j:
      continue
    Aj = A[j]
    if Ai % Aj == 0:
      flg = False
      break
  if flg:
    c += 1
print(c)
    
    

Fixed submission:
N = int(input())
c=[0]*8**7
for a in input().split():
    c[int(a)] += 1
i=r=0
for t in c:
    if t:
        c[::i]=[0]*-(-8**7//i)
    i+=1
    r+=t==1
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
c = 0
for n in input().split():
  i = int(n)
  A.append(i)
for i in range(N):
  Ai = A[i]
  flg = True
  for j in range(N):
    if i == j:
      continue
    Aj = A[j]
    if Ai % Aj == 0:
      flg = False
  if flg:
    c += 1
print(c)
    
    

Fixed submission:
N = int(input())
c=[0]*8**7
for a in input().split():
    c[int(a)] += 1
i=r=0
for t in c:
    if t:
        c[::i]=[0]*-(-8**7//i)
    i+=1
    r+=t==1
print(r)