Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = sorted(list(set(A)))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)


Fixed submission:
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from collections import Counter
n = int(input())
A = np.array(list(map(int, input().split())))
C = Counter(A)
A = np.sort(A)
c = 0
while len(A) > 0:
    ai = A[0]
    AL = A[1:]
    if C[ai] == 1:
        c += 1
    mask = AL % ai != 0
    A = AL[mask]
print(c)


Fixed submission:
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = tuple(map(int, input().split()))
A = sorted(A)
ans = [True] * n

for i in range(n):
    ai = A[i]
    if not ans[i]:
        continue
    try:
        if ai == A[i+1]:
            ans[i] = False
    except:
        pass

    for j in range(i+1, n):
        if A[j]%ai == 0:
            ans[j] = False
print(sum(ans))

Fixed submission:
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = tuple(map(int, input().split()))
A = sorted(A)
ans = [True] * n

for i in range(n):
    ai = A[i]
    if not ans[i]:
        continue
    try:
        if ai == A[i+1]:
            ans[i] = False
    except:
        pass

    for j in range(i+1, n):
        if A[j]%ai == 0:
            ans[j] = False
print(sum(ans))


Fixed submission:
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
A = np.sort(A)
c = 0
while len(A) > 0:
    ai = A[0]
    AL = A[1:]
    if ai != AL[0]:
        c += 1
    mask = AL % ai != 0
    A = AL[mask]
    if len(A) == 1:
        c += 1
        break
print(c)


Fixed submission:
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
A = np.sort(A)
c = 0
while len(A) > 0:
    ai = A[0]
    AL = A[1:]
    if not ai in AL:
        c += 1
    mask = AL % ai != 0
    A = AL[mask]
print(c)


Fixed submission:
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
A = np.array(list(map(int, input().split())))
A = np.sort(A)

c = 0
while len(A) > 0:
    ai = A[0]
    if not ai in A[1:]:
        c += 1
    mask = A[1:] % ai != 0
    A = A[1:][mask]

print(c)


Fixed submission:
from collections import Counter
n = int(input())
A = tuple(map(int, input().split()))
C = Counter(A)
A = list(set(A))
ok = [True] * (10**6+1)

for a in A:
    temp = a+a
    while temp < 10**6+1:
        ok[temp] = False
        temp += a

c = 0
for a in A:
    if C[a] == 1 and ok[a] == True:
        c += 1
print(c)