Buggy python submission (verdict: Runtime Error):
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    if len(a)==1:
        print(1)
        exit()
    tmp=a[1]
    for i in range(n):
        if tmp==a[i]:
            continue
        tmp=a[i]
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                x=a[i]*j
                check[x]=1
                j+=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    #print(a)
    if len(a)==1:
        print(1)
        exit()
    if a[0]==1:
        if a[1]==1:
            print(0)
        else:
            print(1)
        exit()
    for i in range(n):
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                check[x]=1
                j+=1
                x=a[i]*j
            if i<n-1 and a[i+1]==a[i]:
                sum-=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    tmp=a[1]
    for i in range(n):
        if tmp==a[i]:
            continue
        tmp=a[i]
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                x=a[i]*j
                check[x]=1
                j+=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    #print(a)
    if len(a)==1:
        print(1)
        exit()
    if a[0]==1:
        if a[1]==1:
            print(0)
        else:
            print(1)
        exit()
    for i in range(n):
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                check[x]=1
                j+=1
                x=a[i]*j
            if i<n-1 and a[i+1]==a[i]:
                sum-=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    tmp=a[1]
    for i in range(n):
        if tmp==a[i]:
            continue
        tmp=a[i]
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                x=a[i]*j
                check[x]=1
                j+=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    #print(a)
    if len(a)==1:
        print(1)
        exit()
    if a[0]==1:
        if a[1]==1:
            print(0)
        else:
            print(1)
        exit()
    for i in range(n):
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                check[x]=1
                j+=1
                x=a[i]*j
            if i<n-1 and a[i+1]==a[i]:
                sum-=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n=int(input())
    a=list(map(int,input().split()))
    sum=0
    col=[-1 for i in range(n)]
    for i in range(n):
        if col[i]==1:
            continue
        for j in range(i+1,n):
            if a[i]%a[j]==0:
                col[i]=1
            if a[j]%a[i]==0:
                col[j]=1
        if col[i]==-1:
            sum+=1


    print(sum)
if __name__=="__main__":
    main()

Fixed submission:
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    #print(a)
    if len(a)==1:
        print(1)
        exit()
    if a[0]==1:
        if a[1]==1:
            print(0)
        else:
            print(1)
        exit()
    for i in range(n):
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                check[x]=1
                j+=1
                x=a[i]*j
            if i<n-1 and a[i+1]==a[i]:
                sum-=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
check=0
sum=0
col=[-1 for i in range(n)]
for i in range(n):
    for j in range(i+1,n):
        if a[i]%a[j]==0:
            col[i]=1
        if a[j]%a[i]==0:
            col[j]=1
    if col[i]==-1:
        sum+=1


print(sum)

Fixed submission:
def main():
    n=int(input())
    a=list(map(int,input().split()))
    a.sort()
    max=a[-1]
    check=[0 for i in range(max+10)]
    sum=0
    #print(a)
    if len(a)==1:
        print(1)
        exit()
    if a[0]==1:
        if a[1]==1:
            print(0)
        else:
            print(1)
        exit()
    for i in range(n):
        if check[a[i]]==0:
            sum+=1
            j=1
            x=a[i]*j
            while x<max+1:
                check[x]=1
                j+=1
                x=a[i]*j
            if i<n-1 and a[i+1]==a[i]:
                sum-=1
        else:
            continue
    print(sum)
        
    
    
if __name__=="__main__":
    main()