Buggy python submission (verdict: Runtime Error):
# Not Divisible

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

check = [0] * 1000000
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000000, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)


Fixed submission:
# Not Divisible

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

check = [0] * 1000001
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000001, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)

Buggy python submission (verdict: Runtime Error):
# Not Divisible

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

check = [0] * 1000000
A.sort()

ok = []
p = -1
for a in A:
    if a == p:
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000000, a):
        check[i] = 1
    ok.append(a)

print(len(ok))


Fixed submission:
# Not Divisible

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

check = [0] * 1000001
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000001, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)

Buggy python submission (verdict: Time Limit Exceeded):
# Not Divisible

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

A.sort()
ok = []

while 0 < len(A):
    div = True
    for i in range(1, len(A)):
        if A[0] == A[i]:
            div = False
            A[i] = 0
        elif A[i] % A[0] == 0:
            A[i] = 0
    if div:
        ok.append(A[0])
    A[0] = 0
    A = list(filter(lambda a: 0 < a, A))

print(len(ok))


Fixed submission:
# Not Divisible

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

check = [0] * 1000001
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000001, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)

Buggy python submission (verdict: Time Limit Exceeded):
# Not Divisible

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

A.sort()
ok = []

while 0 < len(A):
    div = True
    for i in range(1, len(A)):
        if A[0] == A[i]:
            div = False
            A[i] = 0
        elif A[i] % A[0] == 0:
            A[i] = 0
    if div:
        ok.append(A[0])
    A[0] = 0
    A = list(filter(lambda a: 0 < a, A))

print(len(ok))


Fixed submission:
# Not Divisible

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

check = [0] * 1000001
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000001, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)

Buggy python submission (verdict: Time Limit Exceeded):
# Not Divisible

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

A.sort()

for i in range(len(A) - 1):
    if A[i] == 0:
        continue
    a = A[i]
    for j in range(i + 1, len(A)):
        if a == A[j]:
            A[i] = 0
        if A[j] == 0:
            continue
        if A[j] % a == 0:
            A[j] = 0

print(sum(map(lambda a: 0 < a, A)))


Fixed submission:
# Not Divisible

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

check = [0] * 1000001
A.sort()

ok = [-1]
p = 0
for a in A:
    if a == p:
        if ok[-1] == p:
            ok = ok[:-1]
        continue
    p = a
    if check[a] == 1:
        continue
    for i in range(a, 1000001, a):
        check[i] = 1
    ok.append(a)

print(len(ok) - 1)