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

N = int(sys.stdin.readline())
A = np.array(sorted(map(int, sys.stdin.readline().split(' '))))

dp = np.ones(N, dtype=np.bool)

for i in range(N - 1):
    if not dp[i]:
        continue
    if not np.any(dp[i:]):
        break
    dp[i + 1:] &= (A[i + 1:] % A[i] != 0)
    dp[i] &= (A[i] != A[i + 1])

print(np.count_nonzero(dp))


Fixed submission:
from collections import Counter
import numpy as np

A_MAX = 10 ** 6 + 1

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

dp = np.zeros(shape=A_MAX, dtype=np.int64)

if A[1] == 1:
    print(1)
elif A[1] > 1:
    print(0)
else:
    for a in A.keys():
        multiples = np.arange(a, A_MAX, a)
        np.add.at(dp, multiples, 1)

    ans = 0
    for a, count in A.items():
        if count > 1:
            continue
        if dp[a] == 1:
            ans += 1

    print(ans)

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

N = int(sys.stdin.readline())
A = np.array(sorted(map(int, sys.stdin.readline().split(' '))))

dp = np.ones(N, dtype=np.bool)

for i in range(N - 1):
    if not dp[i]:
        continue
    dp[i + 1:] &= (A[i + 1:] % A[i] != 0)
    dp[i] &= (A[i] != A[i + 1])

print(np.count_nonzero(dp))


Fixed submission:
from collections import Counter
import numpy as np

A_MAX = 10 ** 6 + 1

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

dp = np.zeros(shape=A_MAX, dtype=np.int64)

if A[1] == 1:
    print(1)
elif A[1] > 1:
    print(0)
else:
    for a in A.keys():
        multiples = np.arange(a, A_MAX, a)
        np.add.at(dp, multiples, 1)

    ans = 0
    for a, count in A.items():
        if count > 1:
            continue
        if dp[a] == 1:
            ans += 1

    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

N = int(sys.stdin.readline())
A = sorted(list(map(int, sys.stdin.readline().split(' '))))

ans = 0
while len(A) > 0:
    if not (len(A) > 1 and A[0] == A[1]):
        ans += 1
    A = [a for a in A if a % A[0] != 0]

print(ans)


Fixed submission:
from collections import Counter
import numpy as np

A_MAX = 10 ** 6 + 1

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

dp = np.zeros(shape=A_MAX, dtype=np.int64)

if A[1] == 1:
    print(1)
elif A[1] > 1:
    print(0)
else:
    for a in A.keys():
        multiples = np.arange(a, A_MAX, a)
        np.add.at(dp, multiples, 1)

    ans = 0
    for a, count in A.items():
        if count > 1:
            continue
        if dp[a] == 1:
            ans += 1

    print(ans)

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

N = int(sys.stdin.readline())
A = sorted(list(map(int, sys.stdin.readline().split(' '))))

results = deque()
while len(A) > 0:
    if not (len(A) > 1 and A[0] == A[1]):
        results.append(A[0])
    A = [a for a in A if a % A[0] != 0]

print(len(results))


Fixed submission:
from collections import Counter
import numpy as np

A_MAX = 10 ** 6 + 1

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

dp = np.zeros(shape=A_MAX, dtype=np.int64)

if A[1] == 1:
    print(1)
elif A[1] > 1:
    print(0)
else:
    for a in A.keys():
        multiples = np.arange(a, A_MAX, a)
        np.add.at(dp, multiples, 1)

    ans = 0
    for a, count in A.items():
        if count > 1:
            continue
        if dp[a] == 1:
            ans += 1

    print(ans)

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

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

results = deque()
while len(A) > 0:
    if not (len(A) > 1 and A[0] == A[1]):
        results.append(A[0])
    A = [a for a in A if a % A[0] != 0]

print(len(results))


Fixed submission:
from collections import Counter
import numpy as np

A_MAX = 10 ** 6 + 1

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

dp = np.zeros(shape=A_MAX, dtype=np.int64)

if A[1] == 1:
    print(1)
elif A[1] > 1:
    print(0)
else:
    for a in A.keys():
        multiples = np.arange(a, A_MAX, a)
        np.add.at(dp, multiples, 1)

    ans = 0
    for a, count in A.items():
        if count > 1:
            continue
        if dp[a] == 1:
            ans += 1

    print(ans)

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

N = int(input())
A = np.fromiter(list(map(int, input().split(' '))), dtype=np.int32)
A.sort()

results = deque()
while len(A) > 0:
    if not (len(A) > 1 and A[0] == A[1]):
        results.append(A[0])
    A = A[A % A[0] != 0]

print(len(results))


Fixed submission:
from collections import Counter
import numpy as np

A_MAX = 10 ** 6 + 1

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

dp = np.zeros(shape=A_MAX, dtype=np.int64)

if A[1] == 1:
    print(1)
elif A[1] > 1:
    print(0)
else:
    for a in A.keys():
        multiples = np.arange(a, A_MAX, a)
        np.add.at(dp, multiples, 1)

    ans = 0
    for a, count in A.items():
        if count > 1:
            continue
        if dp[a] == 1:
            ans += 1

    print(ans)

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

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

for a in A:
    A = [x for x in A if (x == a or x % a != 0)]

counter = Counter(A)
print(len([0 for v in counter.values() if v == 1]))


Fixed submission:
from collections import Counter
import numpy as np

A_MAX = 10 ** 6 + 1

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

dp = np.zeros(shape=A_MAX, dtype=np.int64)

if A[1] == 1:
    print(1)
elif A[1] > 1:
    print(0)
else:
    for a in A.keys():
        multiples = np.arange(a, A_MAX, a)
        np.add.at(dp, multiples, 1)

    ans = 0
    for a, count in A.items():
        if count > 1:
            continue
        if dp[a] == 1:
            ans += 1

    print(ans)