Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
a_s = set(a)
s = set()
s1 = set()
same_s = set()
ans = 0
for i in a:
    if i in s1:
        same_s.add(i)
    if i not in s:
        s1.add(i)
        for j in range(i, max(a)+1, i):
            s.add(j)
        ans += 1

print(ans - len(same_s))


Fixed submission:
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
maxa = max(a)
a_s = set(a)
s = set()
s1 = set()
same_s = set()
ans = 0
for i in a:
    if i in s1:
        same_s.add(i)
    if i not in s:
        s1.add(i)
        for j in range(i, maxa+1, i):
            s.add(j)
        ans += 1

print(ans - len(same_s))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
# print(a)
# print(n)
ans = [0 for _ in range(n)]


for i_out in range(n):
    if ans[i_out] == 1:
        continue
    # print(i_out)
    r = np.array(a) / a[i_out] - \
        (np.array(a) / a[i_out]).astype('int64')
    # print(r)
    idx = np.where(r == 0)
    # print(idx)
    # print((np.array(list(idx)))[0].tolist())
    if i_out < n-1:
        if a[i_out] == a[i_out + 1]:
            ans[i_out] = 1
    for i in (np.array(list(idx)))[0].tolist():
        if i == i_out:
            continue
        # print('i', i)
        ans[i] = 1

# print(ans)
print(n - sum(ans))


Fixed submission:
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
maxa = max(a)
a_s = set(a)
s = set()
s1 = set()
same_s = set()
ans = 0
for i in a:
    if i in s1:
        same_s.add(i)
    if i not in s:
        s1.add(i)
        for j in range(i, maxa+1, i):
            s.add(j)
        ans += 1

print(ans - len(same_s))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
# print(a)
# print(n)
ans = [0 for _ in range(n)]


for i_out in range(n):
    for i_in in range(i_out+1, n):  #
        if a[i_out] == a[i_in]:
            ans[i_out] = 1
            ans[i_in] = 1

        if i_out == i_in:
            continue
        # print(i_out, i_in)
        if int(a[i_in] / a[i_out]) == a[i_in] / a[i_out]:
            ans[i_in] = 1
            # print('!')

# print(ans)
print(n - sum(ans))


Fixed submission:
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
maxa = max(a)
a_s = set(a)
s = set()
s1 = set()
same_s = set()
ans = 0
for i in a:
    if i in s1:
        same_s.add(i)
    if i not in s:
        s1.add(i)
        for j in range(i, maxa+1, i):
            s.add(j)
        ans += 1

print(ans - len(same_s))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
# print(a)
# print(n)
ans = [0 for _ in range(n)]


for i_out in range(n):
    for i_in in range(n):  # i_out+1,
        if i_out == i_in:
            continue
        # print(i_out, i_in)
        if int(a[i_in] / a[i_out]) == a[i_in] / a[i_out]:
            ans[i_in] = 1
            # print('!')

# print(ans)
print(n - sum(ans))


Fixed submission:
import numpy as np
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
maxa = max(a)
a_s = set(a)
s = set()
s1 = set()
same_s = set()
ans = 0
for i in a:
    if i in s1:
        same_s.add(i)
    if i not in s:
        s1.add(i)
        for j in range(i, maxa+1, i):
            s.add(j)
        ans += 1

print(ans - len(same_s))