Buggy python submission (verdict: Runtime Error):
n = int(input())
A = sorted(list(map(int, input().split())))
if len(set(A)) == 1:
    print(0)
    exit()

from collections import Counter
c = Counter(A)

NMAX = 2 * 10 ** 5 + 10
dp = [True] * (NMAX + 1)
for k, v in c.items():
    for i in range(k * 2, NMAX + 1, k):
        dp[i] = False

count = 0
for k, v in c.items():
    if v > 1: continue
    if dp[k]: count += 1

print(count)


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

from collections import Counter
c = Counter(A)

NMAX = 10 ** 6 + 1000
dp = [True] * (NMAX + 1)

for x in A:
    if not dp[x]:
        continue
    for i in range(x * 2, NMAX + 1, x):
        dp[i] = False
    if c[x] > 1:
        dp[x] = False
    
count = 0
for x in A:
    if dp[x]:
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = sorted(list(map(int, input().split())))
if len(set(A)) == 1:
    print(0)
    exit()

from collections import Counter
c = Counter(A)

count = 0
NMAX = 2 * 10 ** 5 + 10
L = [True] * (NMAX + 1)
for k, v in c.items():
    if L[k]:
        for i in range(k * 2, NMAX + 1, k):
            L[i] = False

for k, v in c.items():
    if v > 1: continue
    if L[k] == True:
        count += 1

print(count)

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

from collections import Counter
c = Counter(A)

NMAX = 10 ** 6 + 1000
dp = [True] * (NMAX + 1)

for x in A:
    if not dp[x]:
        continue
    for i in range(x * 2, NMAX + 1, x):
        dp[i] = False
    if c[x] > 1:
        dp[x] = False
    
count = 0
for x in A:
    if dp[x]:
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = sorted(list(map(int, input().split())))
if len(set(A)) == 1:
    print(0)
    exit()

from collections import Counter
c = Counter(A)

count = 0
NMAX = 2 * 10 ** 5 + 10
L = [True] * (NMAX + 1)
for k, v in c.items():
    p = k
    if L[p]:
        for i in range(p * 2, NMAX + 1, p):
            L[i] = False

for k, v in c.items():
    if v > 1: continue
    if L[k] == True:
        count += 1

print(count)

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

from collections import Counter
c = Counter(A)

NMAX = 10 ** 6 + 1000
dp = [True] * (NMAX + 1)

for x in A:
    if not dp[x]:
        continue
    for i in range(x * 2, NMAX + 1, x):
        dp[i] = False
    if c[x] > 1:
        dp[x] = False
    
count = 0
for x in A:
    if dp[x]:
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = sorted(list(map(int, input().split())))
if len(set(A)) == 1:
    print(0)
    exit()

from collections import Counter
c = Counter(A)

count = 0
NMAX = 2 * 10 ** 3 + 10
L = [True] * (NMAX + 1)
for k, v in c.items():
    p = k
    if L[p]:
        for i in range(p * 2, NMAX + 1, p):
            L[i] = False

for k, v in c.items():
    if v > 1: continue
    if L[k] == True:
        count += 1

print(count)

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

from collections import Counter
c = Counter(A)

NMAX = 10 ** 6 + 1000
dp = [True] * (NMAX + 1)

for x in A:
    if not dp[x]:
        continue
    for i in range(x * 2, NMAX + 1, x):
        dp[i] = False
    if c[x] > 1:
        dp[x] = False
    
count = 0
for x in A:
    if dp[x]:
        count += 1

print(count)