Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if cnt[a] == 1 and C[a] == 0:
        ans += 1

    i = 1
    while True:
        if a*i > 10**6:
            break
        C[a*i] = 1
        i += 1

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if C[a] == 0:
        i = 1
        while True:
            if a*i > 10**6:
                break
            C[a*i] = 1
            i += 1
        if cnt[a] == 1:
            ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if cnt[a] == 1 and C[a] == 0:
        ans += 1

    i = 1
    while True:
        if a*i > 10**6+1:
            break
        C[a*i] = 1
        i += 1

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if C[a] == 0:
        i = 1
        while True:
            if a*i > 10**6:
                break
            C[a*i] = 1
            i += 1
        if cnt[a] == 1:
            ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cou = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if C[a] == 0 and C[a] == 0:
        ans += 1

    i = 1
    while True:
        if a*i > 10**6+1:
            break
        C[a*i] = 1
        i += 1

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if C[a] == 0:
        i = 1
        while True:
            if a*i > 10**6:
                break
            C[a*i] = 1
            i += 1
        if cnt[a] == 1:
            ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cou = Counter(A) 

A = list(set(A))
A.sort()

C = [0]*(10**6+1)
for a in A:
    if C[a] == 0 and C[a] == 0:
        ans += 1

    i = 1
    while True:
        if a*i > 10**6+1:
            break
        C[a*i] = 1
        i += 1

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if C[a] == 0:
        i = 1
        while True:
            if a*i > 10**6:
                break
            C[a*i] = 1
            i += 1
        if cnt[a] == 1:
            ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cou = Counter(A) 

A = list(set(A))
A.sort()

C = [A[0]]
for i in range(1, len(A)):
    Flag = True
    for c in C:
        if A[i] % c == 0:
            Flag = False
            break
    if Flag == True:
        C.append(A[i])

ans = 0
for i in C:
    if cou[i] == 1:
        ans += 1

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = list(map(int, input().split()))

cnt = Counter(A) 

A = list(set(A))
A.sort()


C = [0]*(10**6+1)
ans = 0

for a in A:
    if C[a] == 0:
        i = 1
        while True:
            if a*i > 10**6:
                break
            C[a*i] = 1
            i += 1
        if cnt[a] == 1:
            ans += 1

print(ans)