Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    A.sort()
    C = Counter(A)

    MAX = 2000005
    T = [0]*MAX

    ans = 0
    for a in A:
        if T[a]:
            continue
        else:
            if C[a] == 1:
                ans += 1
            for i in range(2*a, MAX, a):
                T[i] += 1
    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in C.keys():
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in C.items():
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    A.sort()
    C = Counter(A)

    MAX = 2000005
    T = [0]*MAX

    ans = 0
    for a in A:
        if T[a]:
            continue
        else:
            if C[a] == 1:
                ans += 1
            for i in range(2*a, MAX, a):
                T[i] += 1
    print(ans)

@jit()

if __name__ == '__main__':
    main()


Fixed submission:
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in C.keys():
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in C.items():
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    A.sort()
    C = Counter(A)

    MAX = 2000005
    T = [0]*MAX

    ans = 0
    for a in A:
        if T[a]:
            continue
        else:
            if C[a] == 1:
                ans += 1
            for i in range(2*a, MAX, a):
                T[i] += 1
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in C.keys():
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in C.items():
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
*A, = map(int, input().split())
C = Counter(A)

if 1 in C:
    if C[1] == 1:
        print(1)
    else:
        print(0)
    exit()

ans = 0
for k, v in C.items():
    if v > 1:
        continue
    for i in range(2, int(k**0.5)+1):
        if k % i == 0:
            if i in C:
                break
            if k // i in C:
                break
    else:
        ans += 1
print(ans)


Fixed submission:
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in C.keys():
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in C.items():
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
*A, = map(int, input().split())
C = Counter(A)

if 1 in C:
    if C[1] == 1:
        print(1)
    else:
        print(0)
    exit()

B = []
for k, v in C.items():
    if v > 1:
        continue
    B.append(k)

ans = 0
for i, a in enumerate(B):
    for i in range(2, int(a**0.5)+1):
        if a % i == 0:
            if i in C:
                break
            if a // i in C:
                break
    else:
        ans += 1

print(ans)


Fixed submission:
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in C.keys():
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in C.items():
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
*A, = map(int, input().split())
C = Counter(A)
S = set(A)

if 1 in S:
    if C[1] == 1:
        print(1)
    else:
        print(0)
    exit()

ans = 0
for i, a in enumerate(A):
    if C[a] > 1:
        continue
    for i in range(2, int(a**0.5)+1):
        if a % i == 0:
            if i in S:
                break
            if a // i in S:
                break
    else:
        ans += 1

print(ans)


Fixed submission:
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in C.keys():
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in C.items():
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter

N = int(input())
*A, = map(int, input().split())
C = Counter(A)
S = set(A)

if 1 in S:
    if C[1] == 1:
        print(1)
    else:
        print(0)
    exit()

ans = 0
for i, a in enumerate(A):
    if C[a] > 1:
        continue
    for i in range(2, int(a**0.5)+1):
        if a % i == 0:
            if i in S:
                break
            if a // i in S:
                break
    else:
        ans += 1

print(ans)


Fixed submission:
from collections import Counter

def main():
    N = int(input())
    *A, = map(int, input().split())
    C = Counter(A)

    MAX = 1000005
    T = [0]*MAX

    ans = 0
    for a in C.keys():
        if T[a]:
            continue
        else:
            for i in range(2*a, MAX, a):
                T[i] = 1

    ans = 0
    for a, n in C.items():
        if n == 1 and T[a] == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    main()