Buggy python submission (verdict: Runtime Error):
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * array[N-1]
i = 0
before = 0
for i in array:
    j = 2*i
    if i == before:
        array[i] == False
    while j < array[N-1]:
        array[j] == False
        j += i
    before = i
for i in array:
    if array[i] == True:
        ans += 1
print(ans)

Fixed submission:
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * (10**6 + 1)
i = 0
before = 0
for i in array:
    if a[i] == True:
        j = 2*i
        if i == before:
            a[i] = False
        while j <= array[N-1]:
            a[j] = False
            j += i
        before = i
for i in array:
    if a[i] == True:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * array{N}
i = 0
before = 0
for i in array:
    j = 2*i
    if i == before:
        array[i] == False
    while j < array[N]:
        array[j] == False
        j += i
    before = i
for i in array:
    if array[i] == True:
        ans += 1
print(ans)

Fixed submission:
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * (10**6 + 1)
i = 0
before = 0
for i in array:
    if a[i] == True:
        j = 2*i
        if i == before:
            a[i] = False
        while j <= array[N-1]:
            a[j] = False
            j += i
        before = i
for i in array:
    if a[i] == True:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = N
a = [True] * N
i = 0
for i in range(len(array)):
    j = i + 1
    while j < len(array):
        if (array[j] % array[i] == 0 or array[j] == array[i]):
            array.pop(j)
            ans -= 1
            if j == len(array) -1:
                break
        else:
            j += 1
if (array[len(array)-1] == array[len(array)-2]):
    ans -= 1
if (array[0] == array[1]):
    ans -= 1
print(ans)

Fixed submission:
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * (10**6 + 1)
i = 0
before = 0
for i in array:
    if a[i] == True:
        j = 2*i
        if i == before:
            a[i] = False
        while j <= array[N-1]:
            a[j] = False
            j += i
        before = i
for i in array:
    if a[i] == True:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
array = list(map(int, input().strip().split()))
ans = 0
a = [True] * len(array)
for i in range(N):
    for j in range(N):
        if a[i] == False:
            break
        if i != j and (array[i] % array[j] == 0 or array[i] == array[j]) :
            break
        if i != j and (array[j] % array[i] == 0):
            a[j] == False
        if j == N-1:
            ans += 1
print(ans)

Fixed submission:
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * (10**6 + 1)
i = 0
before = 0
for i in array:
    if a[i] == True:
        j = 2*i
        if i == before:
            a[i] = False
        while j <= array[N-1]:
            a[j] = False
            j += i
        before = i
for i in array:
    if a[i] == True:
        ans += 1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
array = list(map(int, input().strip().split()))
ans = 0
for i in range(N):
    for j in range(N):
        if i != j:
            if array[i] % array[j] == 0 or array[i] == array[j] :
                break
        if j == N-1:
            ans += 1
print(ans)

Fixed submission:
N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ans = 0
a = [True] * (10**6 + 1)
i = 0
before = 0
for i in array:
    if a[i] == True:
        j = 2*i
        if i == before:
            a[i] = False
        while j <= array[N-1]:
            a[j] = False
            j += i
        before = i
for i in array:
    if a[i] == True:
        ans += 1
print(ans)