Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[True]*1000001
count=0
if n==1:
  count=1
else:
  for i in range(0,n):
    pp=a[i]
    if table[pp]==True:
      if i==0:
        if a[i]!=a[i+1]:
          count+=1
          for j in range(pp,1000002,pp):
            table[j]=False
      elif i==n-1:
        if a[i]!=a[i-1]:
          count+=1
          for j in range(pp,1000002,pp):
            table[j]=False
      else:
        if a[i]!=a[i+1] and a[i]!=a[i-1]:
          count+=1
          for j in range(pp,1000002,pp):
            table[j]=False
      
print(count)
  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[True]*1000001
count=0
if n==1:
  count=1
else:
  for i in range(0,n):
    pp=a[i]
    if table[pp]==True:
      if i==0:
        if pp!=a[i+1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      elif i==n-1:
        if pp!=a[n-2]:
          count+=1
      else:
        if pp!=a[i+1] and pp!=a[i-1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      
print(count)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[True]*1000001
count=0
for i in range(0,n):
  pp=a[i]
  if table[pp]==True:
    if i==0:
      if a[i]!=a[i+1]:
        count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
    elif i==n-1:
      if a[i]!=a[i-1]:
        count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
    else:
      if a[i]!=a[i+1] and a[i]!=a[i-1]:
        count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      
print(count)
  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[True]*1000001
count=0
if n==1:
  count=1
else:
  for i in range(0,n):
    pp=a[i]
    if table[pp]==True:
      if i==0:
        if pp!=a[i+1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      elif i==n-1:
        if pp!=a[n-2]:
          count+=1
      else:
        if pp!=a[i+1] and pp!=a[i-1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      
print(count)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[]
for i in range(1000001):
  table.append([True,0])
count=0
for i in range(0,n):
  pp=a[i]
  if table[pp][0]==True:
    if i==0:
      if a[i]!=a[i+1]:
        count+=1
    elif i==n-1:
      if a[i]!=a[i-1]:
        count+=1
    else:
      if a[i]!=a[i+1] and a[i]!=a[i-1]:
        count+=1
  if table[pp][1]==0:
    table[pp][1]=1
    for j in range(pp,1000001,pp):
      table[j][0]=False
      
print(count)
  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[True]*1000001
count=0
if n==1:
  count=1
else:
  for i in range(0,n):
    pp=a[i]
    if table[pp]==True:
      if i==0:
        if pp!=a[i+1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      elif i==n-1:
        if pp!=a[n-2]:
          count+=1
      else:
        if pp!=a[i+1] and pp!=a[i-1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      
print(count)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[]
for i in range(1000001):
  table.append([True,0])
count=0
for i in range(0,n):
  if table[a[i]][0]==True:
    count+=1
  if table[a[i]][1]==0:
    table[a[i]][1]=1
    for j in range(a[i],1000002,a[i]):
      table[j][0]=False
  elif table[a[i]][1]==1:
    count-=1
    table[a[i]][1]=2
      
print(count)
  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))

a.sort()

table=[True]*1000001
count=0
if n==1:
  count=1
else:
  for i in range(0,n):
    pp=a[i]
    if table[pp]==True:
      if i==0:
        if pp!=a[i+1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      elif i==n-1:
        if pp!=a[n-2]:
          count+=1
      else:
        if pp!=a[i+1] and pp!=a[i-1]:
          count+=1
        for j in range(pp,1000001,pp):
          table[j]=False
      
print(count)