Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter 
n = int(input())
a = sorted(list(map(int, input().split())))
s = sorted(set(a))
c = Counter(a)
t = [0] * (10**6 + 1)
for i in a:
    for j in range(i, 10**6+1, i):
        t[j] += 1

ans = sum(1 for i in a if t[i] == 1 and c[i] == 1)
print(ans)



Fixed submission:
from collections import Counter 
n = int(input())
a = list(map(int, input().split()))
s = set(a)
c = Counter(a)
t = [0] * (10**6 + 1)
for i in s:
    for j in range(i, 10**6+1, i):
        t[j] += 1

ans = len([1 for i in s if t[i] == 1 and c[i] == 1])
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter 
n = int(input())
a = sorted(list(map(int, input().split())))
s = sorted(set(a))
c = Counter(a)
t = [0] * (10**6 + 1)
for i in a:
    for j in range(i, 10**6+1, i):
        t[j] += 1
print(len(i for i in a if t[i] == 1 and c[i] == 1))



Fixed submission:
from collections import Counter 
n = int(input())
a = list(map(int, input().split()))
s = set(a)
c = Counter(a)
t = [0] * (10**6 + 1)
for i in s:
    for j in range(i, 10**6+1, i):
        t[j] += 1

ans = len([1 for i in s if t[i] == 1 and c[i] == 1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter 
n = int(input())
a = sorted(list(map(int, input().split())))
s = sorted(set(a))
c = Counter(a)
t = [0] * (10**6 + 1)
for i in a:
    for j in range(i, 10**6+1, i):
        t[j] += 1
print(sum(1 for i in a if t[i] == 1 and c[i] == 1))



Fixed submission:
from collections import Counter 
n = int(input())
a = list(map(int, input().split()))
s = set(a)
c = Counter(a)
t = [0] * (10**6 + 1)
for i in s:
    for j in range(i, 10**6+1, i):
        t[j] += 1

ans = len([1 for i in s if t[i] == 1 and c[i] == 1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter 
n = int(input())
a = sorted(list(map(int, input().split())))
s = sorted(set(a))
c = Counter(a)
bool = [True] * (10**6 + 1)
for i in a:
    if c[i] > 1 :
        bool[i] = False 
    for j in range(i*2, 10**6+1, i):
        bool[j] = False 
print(sum(1 for i in a if bool[i]))



Fixed submission:
from collections import Counter 
n = int(input())
a = list(map(int, input().split()))
s = set(a)
c = Counter(a)
t = [0] * (10**6 + 1)
for i in s:
    for j in range(i, 10**6+1, i):
        t[j] += 1

ans = len([1 for i in s if t[i] == 1 and c[i] == 1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter 
n = int(input())
a = sorted(list(map(int, input().split())))
s = sorted(set(a))
c = Counter(a)
bool = [True] * (10**6 + 1)
for i in a:
    if c[i] > 1 :
        bool[i] = False 
    for j in range(i*2, 10**6+1, i):
        bool[j] = False 
print(sum(1 for i in a if bool[i]))



Fixed submission:
from collections import Counter 
n = int(input())
a = list(map(int, input().split()))
s = set(a)
c = Counter(a)
t = [0] * (10**6 + 1)
for i in s:
    for j in range(i, 10**6+1, i):
        t[j] += 1

ans = len([1 for i in s if t[i] == 1 and c[i] == 1])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
alist = list(map(int, input().split()))
cnt = 0
for i in range(n):
    a = alist[:i] + alist[i+1:]
    if all(alist[i]%a[j] for j in range(n-1)):
        cnt += 1
print(cnt)



Fixed submission:
from collections import Counter 
n = int(input())
a = list(map(int, input().split()))
s = set(a)
c = Counter(a)
t = [0] * (10**6 + 1)
for i in s:
    for j in range(i, 10**6+1, i):
        t[j] += 1

ans = len([1 for i in s if t[i] == 1 and c[i] == 1])
print(ans)