Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))

Cnt = [0 for i in range(10**6 + 7)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    else:
        pass
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))

Cnt = [0 for i in range(10**6 + 8)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    else:
        pass
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int, input().split()))

Cnt = [0 for i in range(10**6 + 7)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))

Cnt = [0 for i in range(10**6 + 8)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    else:
        pass
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
A = deque(sorted(list(map(int, input().split())), reverse = True))

ans = 0
while len(A) > 0:    
    f = 0
    ans += 1
    s = A.pop()
    N = deque([])
    if len(A) == 0:
        break
    else:
        for i in range(len(A)):
            t = A.popleft()
            if t == s:
                f = 1
            elif t % s == 0:
                f = 0
            else:
                N.append(t)

        A = N
        #print(A)

        if f == 1:
            ans -= 1
        else:
            pass

print(ans)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))

Cnt = [0 for i in range(10**6 + 8)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    else:
        pass
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
A = deque(sorted(list(map(int, input().split())), reverse = True))

ans = 0
while len(A) > 0:    
    f = 0
    ans += 1
    s = A.pop()
    N = deque([])
    if len(A) == 0:
        break
    else:
        for i in range(len(A)):
            t = A.popleft()
            if t == s:
                f = 1
            elif t % s == 0:
                f = 0
                pass
            else:
                N.append(t)

        A = N
        #print(A)

        if f == 1:
            ans -= 1
        else:
            pass

print(ans)

Fixed submission:
n = int(input())
A = list(map(int, input().split()))

Cnt = [0 for i in range(10**6 + 8)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    else:
        pass
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)