Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 2*100000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 1000000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 2*100000 + 9
dp = [True] * MAX
for num in a.keys():
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 1000000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 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()))
dp = [1] * (max(a)+9)
for num in a:
    for i in range(num*2, max(a) + 9, num):
        dp[i] = 0
ans = 0
count = Counter(a)
for num in a:
    if count[num] == 1:
        ans += dp[num]
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 1000000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
nums = sorted(list(a.keys()))
ans = n
for i, num in enumerate(nums):
    if a[num] > 1:
        ans -= a[num]
        continue
    if i == 0:
        continue
    search_range = nums[:i]
    for i in search_range:
        if num % i == 0:
            ans -= a[num]
            break
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 1000000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
from math import sqrt
n = int(input())
a = Counter(map(int, input().split()))
ans = n
for num, count in a.items():
    if count > 1:
        ans -= count
        continue
    if 1 in a and num != 1:
        ans -= count
        continue
    i = 2
    while i <= sqrt(num):
        if num % i == 0:
            if i in a or (num // i) in a:
                ans -= count
                break
        i += 1
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 1000000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
ans = n
for num, count in a.items():
    if count > 1:
        ans -= count
        continue
    if 1 in a and num != 1:
        ans -= count
        continue
    i = 2
    if num % i == 0:
            if i in a or (num // i) in a:
                ans -= count
                break
        i += 1
    while i * i <= num:
        if num % i == 0:
            if i in a or (num // i) in a:
                ans -= count
                break
        i += 2
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 1000000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
ans = n
for num, count in a.items():
    if count > 1:
        ans -= count
        continue
    if 1 in a and num != 1:
        ans -= count
        continue
    i = 2
    while i * i <= num:
        if num % i == 0:
            if i in a or (num // i) in a:
                ans -= count
                break
        i += 1
print(ans)


Fixed submission:
from collections import Counter
n = int(input())
a = Counter(map(int, input().split()))
MAX = 1000000 + 9
dp = [True] * MAX
for num in a:
    for i in range(num*2, MAX, num):
        dp[i] = False
ans = 0
for num in a:
    if dp[num] and a[num] == 1:
        ans += 1
print(ans)