Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

count = [0] * (max(A)+1)
for a in A:    
    if count[a] != 0:
        count[a] = 2
        continue

    for j in range(a, max(A)+1, a):
        count[j] += 1

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

print(ans)


Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

count = [0] * (max(A)+1)
for i in range(len(A)):
    a = A[i]
    
    if count[a] != 0:
        count[a] = 2
        continue

    for j in range(a, max(A)+1, a):
        count[j] += 1

ans = 0
for i in range(len(A)):
    a = A[i]
    if count[a] == 1:
        ans += 1

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(i) for i in input().split()]

count = [0] * (max(A)+1)
for i in range(len(A)):
    a = A[i]
    
    if count[a] != 0:
        count[a] = 2
        continue

    for j in range(a, max(A)+1, a):
        count[j] += 1

ans = 0
for i in range(len(A)):
    a = A[i]
    if count[a] == 1:
        ans += 1

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

N = int(input())
A = sorted([int(i) for i in input().split()])

dp = [-1] * (A[-1]+1)
ans = 0
for i in range(N):
    a = A[i]
    if dp[a] != -1:
        continue

    if A.count(a) == 1:
        ans += 1
        for j in range(a+a, A[-1]+1, a):
            dp[j] = 0

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
A = sorted([int(i) for i in input().split()])

dp = np.array([-1] * (A[-1]+1))
ans = 0
for i in range(N):
    a = A[i]
    if dp[a] != -1:
        continue

    if dp[a] == -1 and A.count(a) == 1:
        ans += 1
        dp[range(a+a, A[-1]+1, a)] = 0

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted([int(i) for i in input().split()])

dp = [-1] * (A[-1]+1)
ans = 0
for i in range(N):
    a = A[i]
    if dp[a] == -1 and A.count(a) == 1:
        ans += 1
        for j in range(a+a, A[-1]+1, a):
            dp[j] = 0
    else:
        continue

print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

N = int(input())
A = sorted([int(i) for i in input().split()])
a = collections.Counter(A)
A = np.array([i[0] for i in a.items() if i[1] == 1])

if len(A) == 0:
    print(0)
else:
    dp = np.array([True for i in range(A[-1])])
    dp[:A[0]-1] = False
    ans = 0
    for i in range(A[-1]):
        if i+1 in A and dp[i] == True:
            n = i+1
            dp[A[np.where(A % n == 0)[0]]-1] = False
            dp[i] = True
        else:
            dp[i] = False
    print(np.sum(dp))

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
A = sorted([int(i) for i in input().split()])
A = np.array(A)

ans = 0
while len(A) > 1:
    if A[0] != A[1]:
        ans += 1
    n = A[0]
    A = A[np.where(A % n != 0)[0]]
    
if len(A) == 1:
    print(ans+1)
else:
    print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())
A = sorted([int(i) for i in input().split()])
A = np.array(A)

ans = 0
while len(A) > 0:
    if len(A) == 1:
        ans += 1
    elif A[0] != A[1]:
        ans += 1
    n = A[0]
    A = A[np.where(A % n != 0)[0]]
    
print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

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

N = int(input())
A = sorted([int(i) for i in input().split()])

limit = int(A[-1] ** 0.5)
ans = 0
while limit > A[0]:
    if len(A) == 1:
        ans += 1
    elif A[0] != A[1]:
        ans += 1
    A = [i for i in A if i % A[0] != 0]
    
a = collections.Counter(A)
print(ans + len([i[0] for i in a.items() if i[1] == 1]))

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = sorted([int(i) for i in input().split()])

ls = []
for i in range(N):
    if A.count(A[i]) == 1:
        ls.append(A[i])

if len(ls) == 0:
    print(0)
else:
    limit = int(ls[-1] ** 0.5)
    ans = 0
    while limit > ls[0]:
        if len(ls) == 1:
            ans += 1
        elif ls[0] != ls[1]:
            ans += 1
        ls = [i for i in ls if i % ls[0] != 0]
    
    print(ans+len(ls))

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = sorted([int(i) for i in input().split()])

ans = 0
while len(A) > 0:
    if len(A) == 1:
        ans += 1
    elif A[0] != A[1]:
        ans += 1
    A = [i for i in A if i % A[0] != 0]
    
print(ans)

Fixed submission:
from collections import Counter

N = int(input())
A = [int(i) for i in input().split()]
num = set(A)
count = Counter(A)
dp = [True] * (10**6 + 1)

for a in num:
    for n in range(a+a, 10**6+1, a):
        dp[n] = False

ans = 0
for a in num:
    if count[a] == 1 and dp[a] == True:
        ans += 1

print(ans)