Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
cola = Counter(a)
mult = [True] * (10**6+1)
seta = list(set(a))

for s in seta:
    tmp = s * 2
    while tmp <= 10 ** 6:
        mult[tmp] = False
        tmp += s

ans = 0
for s in seta:
    if cola[s] == 1 and mult[s] == True:
        ans += 1

print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
m = [True] * (10**6+1)
s = list(set(a))
for u in s:
    t = u * 2
    while t <= 10 ** 6:
        m[t] = False
        t += u
r = 0
for u in s:
    if c[u] == 1 and m[u] == True:
        r += 1
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
a = [int(i) for i in input().split()]
cola = collections.Counter(a)
mult = [True] * (10**6+1)
seta = set(a)

for s in seta:
  tmp = s * 2
  while tmp <= 10 ** 6:
    mult[tmp] = False
    tmp += s
  
ans = 0
for s in seta:
  if cola[s] == 1 and mult[s] == True:
    ans += 1
    
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
m = [True] * (10**6+1)
s = list(set(a))
for u in s:
    t = u * 2
    while t <= 10 ** 6:
        m[t] = False
        t += u
r = 0
for u in s:
    if c[u] == 1 and m[u] == True:
        r += 1
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
a = [int(i) for i in input().split()]
cola = collections.Counter(a)
mult = [1] * (10**6+1)
seta = set(a)

for s in seta:
  tmp = s * 2
  while tmp <= 10 ** 6:
    mult[tmp] = 0
    tmp += s
  
ans = 0
for s in seta:
  if cola[s] == 1 and mult[s] == 1:
    ans += 1
    
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
m = [True] * (10**6+1)
s = list(set(a))
for u in s:
    t = u * 2
    while t <= 10 ** 6:
        m[t] = False
        t += u
r = 0
for u in s:
    if c[u] == 1 and m[u] == True:
        r += 1
print(r)

Buggy python submission (verdict: Time Limit Exceeded):
import collections
n = int(input())
a = [int(i) for i in input().split()]
cola = collections.Counter(a)
mult = [1] * (10**6+1)

for s in set(a):
  tmp = s * 2
  while tmp <= 10 ** 6:
    mult[tmp] = 0
    tmp += s
  
ans = 0
for s in set(a):
  if cola[s] == 1 and mult[s] == 1:
    ans += 1
    
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
m = [True] * (10**6+1)
s = list(set(a))
for u in s:
    t = u * 2
    while t <= 10 ** 6:
        m[t] = False
        t += u
r = 0
for u in s:
    if c[u] == 1 and m[u] == True:
        r += 1
print(r)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
cnt = 0

s = [a[0]]
for i in range(1, n):
  s.append(a[i] * s[i-1])

for i in range(n):
  if i == 0:
    if a[i] != a[i+1]:
      cnt += 1
    continue
  if i != n-1:
    if a[i] % s[i-1] != 0 and a[i+1] != a[i]:
    cnt += 1
  if i == n-1:
    if a[i] % s[i-1] != 0:
      cnt += 1

print(cnt)


Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
m = [True] * (10**6+1)
s = list(set(a))
for u in s:
    t = u * 2
    while t <= 10 ** 6:
        m[t] = False
        t += u
r = 0
for u in s:
    if c[u] == 1 and m[u] == True:
        r += 1
print(r)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [int(i) for i in input().split()]
a.sort()

cnt = 0

for i in range(n):
  if i == 0 and a[i+1] == a[i]:
    continue
  elif i == n-1 and a[i-1] == a[i]:
    continue
  elif i > 0 and i < n-1 and (a[i+1] == a[i] or a[i-1] == a[i]):
    continue
  
  flag = True
  for j in range(i):
    if a[i] % a[j] == 0:
      flag = False
      break
  if flag:
    cnt += 1
    
print(cnt)
  

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
m = [True] * (10**6+1)
s = list(set(a))
for u in s:
    t = u * 2
    while t <= 10 ** 6:
        m[t] = False
        t += u
r = 0
for u in s:
    if c[u] == 1 and m[u] == True:
        r += 1
print(r)