Buggy python submission (verdict: Time Limit Exceeded):
def main():
    """"ここに今までのコード"""

    n = int(input())
    a = list(map(int, input().split()))
    a.sort()
    count = 0
    while a != []:
        t = a[0]
        if len(a) == 1:
            count +=1
        elif a[0] != a[1]:
            count +=1
        a = [i for i in a if i % t != 0]
    
    print(count)

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3
import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n=int(input())
    A=list(map(int, input().split()))
    counts=[0]*(10**6+5)
    for AA in A:
        counts[AA]+=1
    ans=0
    for i in range(1,10**6+5):
        if counts[i]>0:
            for j in range(i+i,10**6+5,i):
                counts[j]=-1
        if counts[i]==1:
            ans+=1
    print(ans)
        

        
    


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a.sort()
count = 0
while a != []:
    t = a[0]
    if len(a) == 1:
        count +=1
    elif a[0] != a[1]:
        count +=1
    a = [i for i in a if i % t != 0]
    

print(count)


Fixed submission:
#!/usr/bin/env python3
import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n=int(input())
    A=list(map(int, input().split()))
    counts=[0]*(10**6+5)
    for AA in A:
        counts[AA]+=1
    ans=0
    for i in range(1,10**6+5):
        if counts[i]>0:
            for j in range(i+i,10**6+5,i):
                counts[j]=-1
        if counts[i]==1:
            ans+=1
    print(ans)
        

        
    


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a.sort()
count = 0
while a != []:
    t = a[0]
    if len(a) == 1:
        count +=1
    elif a[0] != a[1]:
        count +=1
    a = [i for i in a if i % t != 0]
    

print(count)


Fixed submission:
#!/usr/bin/env python3
import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n=int(input())
    A=list(map(int, input().split()))
    counts=[0]*(10**6+5)
    for AA in A:
        counts[AA]+=1
    ans=0
    for i in range(1,10**6+5):
        if counts[i]>0:
            for j in range(i+i,10**6+5,i):
                counts[j]=-1
        if counts[i]==1:
            ans+=1
    print(ans)
        

        
    


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a.sort()
count = 0
while a != []:
    t = a[0]
    if len(a) == 1:
        count +=1
    elif a[0] != a[1]:
        count +=1
    a = [i for i in a if i % t != 0]
    

print(count)


Fixed submission:
#!/usr/bin/env python3
import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n=int(input())
    A=list(map(int, input().split()))
    counts=[0]*(10**6+5)
    for AA in A:
        counts[AA]+=1
    ans=0
    for i in range(1,10**6+5):
        if counts[i]>0:
            for j in range(i+i,10**6+5,i):
                counts[j]=-1
        if counts[i]==1:
            ans+=1
    print(ans)
        

        
    


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
a.sort()
wa = []
while a != []:
    t = a[0]
    if len(a) == 1:
        wa.append(t)
    elif a[0] != a[1]:
        wa.append(t)
    han = int(max(a)/t)+2
    bai = [i*t for i in range(1, han)]
    a = [i for i in a if i not in bai]
    

print(len(wa))

Fixed submission:
#!/usr/bin/env python3
import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n=int(input())
    A=list(map(int, input().split()))
    counts=[0]*(10**6+5)
    for AA in A:
        counts[AA]+=1
    ans=0
    for i in range(1,10**6+5):
        if counts[i]>0:
            for j in range(i+i,10**6+5,i):
                counts[j]=-1
        if counts[i]==1:
            ans+=1
    print(ans)
        

        
    


if __name__ == '__main__':
    main()