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

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for i in range(N):
    cnt[A[i]] += 1
for i in range(N-1):
    if cnt[A[i]] != 0:
        cnt[A[i]*2::A[i]] = 0
ans = np.count_nonzero(cnt==1)
print(ans)

Fixed submission:
import numpy as np
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for x in A:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    cnt[x::x] += 1
ans = 0
for x in A:
    if cnt[x] == 1:
        ans += 1
print(ans)

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

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for i in range(N):
    cnt[A[i]] += 1
for i in range(N-1):
    if cnt[A[i]] != 0:
        cnt[A[i]*2::A[i]] = 0
ans = np.count_nonzero(cnt==1)
print(ans)

Fixed submission:
import numpy as np
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for x in A:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    cnt[x::x] += 1
ans = 0
for x in A:
    if cnt[x] == 1:
        ans += 1
print(ans)

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

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for i in range(N):
    cnt[A[i]] += 1
for i in range(N-1):
    cnt[A[i]*2::A[i]] = 0
ans = np.count_nonzero(cnt==1)
print(ans)

Fixed submission:
import numpy as np
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for x in A:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    cnt[x::x] += 1
ans = 0
for x in A:
    if cnt[x] == 1:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for i in range(N):
    cnt[A[i]] += 1
for i in range(N-1):
    cnt[A[i]*2::A[i]] += 2
ans = np.count_nonzero(cnt==1)
print(ans)

Fixed submission:
import numpy as np
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for x in A:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    cnt[x::x] += 1
ans = 0
for x in A:
    if cnt[x] == 1:
        ans += 1
print(ans)

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

N = int(input())
A = list(map(int, (input().split())))
cntA = Counter(A)
A = sorted(list(set(A)))
setA = set()
for k, v in cntA.items():
    if v==1:
        setA.add(k)
# print(setA)
for i in range(len(A)-1):
    for j in range(i+1, len(A)):
        if A[j] % A[i] == 0:
            if A[j] in setA:
                setA.remove(A[j])
print(len(setA))


Fixed submission:
import numpy as np
import sys
input = sys.stdin.buffer.readline

N = int(input())
A = list(map(int, (input().split())))
A.sort()
cnt = np.zeros(10**6+10, dtype=np.int32)
for x in A:
    if cnt[x] != 0:
        cnt[x] = 2
        continue
    cnt[x::x] += 1
ans = 0
for x in A:
    if cnt[x] == 1:
        ans += 1
print(ans)