Buggy python submission (verdict: Time Limit Exceeded):
import sys 
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = list(map(int,readline().split()))
A = sorted(set(S))
q = deque(A)
ans = 0
while q:
  t = q.popleft()
  if t == 1:
    if S.count(1) == 1:
      print(1)
      sys.exit()
    else:
      print(0)
      sys.exit()
  if S.count(t) ==1:
    ans += 1
  count = 0
  for j in range(len(q)):
    if q[j] % t == 0:
      count +=1
      q.remove(q[j])
      q.appendleft(1)
  for i in range(count):
    q.remove(1)
print(ans)


Fixed submission:
import sys 
import numpy as np
from numba import jit
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


@jit(cache=True)
def solve(A):
  count = np.zeros(10**6+10)
  for x in A:
    if count[x] > 1:
      continue
    count[::x] += 1
  ans = 0
  for x in A:
    ans += count[x] == 1
  return ans

N = int(readline())
A = list(map(int,readline().split()))
A = np.array(A)
print(solve(A))

Buggy python submission (verdict: Time Limit Exceeded):
import sys 
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = list(map(int,readline().split()))
A = sorted(set(S))
q = deque(A)
ans = 0
while q:
  t = q.popleft()
  if t == 1:
    if S.count(1) == 1:
      print(1)
      sys.exit()
    else:
      print(0)
      sys.exit()
  if S.count(t) ==1:
    ans += 1
  count = 0
  for j in range(len(q)):
    if q[j] % t == 0:
      count +=1
      q.remove(q[j])
      q.appendleft(1)
  for i in range(count):
    q.remove(1)
print(ans)

Fixed submission:
import sys 
import numpy as np
from numba import jit
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


@jit(cache=True)
def solve(A):
  count = np.zeros(10**6+10)
  for x in A:
    if count[x] > 1:
      continue
    count[::x] += 1
  ans = 0
  for x in A:
    ans += count[x] == 1
  return ans

N = int(readline())
A = list(map(int,readline().split()))
A = np.array(A)
print(solve(A))

Buggy python submission (verdict: Runtime Error):
import sys 
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))
A = list(sorted(A))
q = deque(A)
ans = 0
while q:
  t = q.popleft()
  cnt = q.count(t)
  if t == 1:
    if cnt == 0:
      print(1)
      sys.exit()
    else:
      print(0)
      sys.exit()
  if cnt == 0:
    ans += 1
  count = 0
  for j in range(len(q)):
    if q[j] % t == 0:
      count +=1
      q.remove(q[j])
      q.appendleft(1)
    for i in range(count):
      q.remove(1)
print(ans)

Fixed submission:
import sys 
import numpy as np
from numba import jit
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


@jit(cache=True)
def solve(A):
  count = np.zeros(10**6+10)
  for x in A:
    if count[x] > 1:
      continue
    count[::x] += 1
  ans = 0
  for x in A:
    ans += count[x] == 1
  return ans

N = int(readline())
A = list(map(int,readline().split()))
A = np.array(A)
print(solve(A))

Buggy python submission (verdict: Time Limit Exceeded):
import sys 
from collections import deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
A = list(map(int,readline().split()))
A = list(sorted(A))
q = deque(A)
ans = 0
while q:
  t = q.popleft()
  cnt = q.count(t)
  if t == 1:
    if cnt == 0:
      print(1)
      sys.exit()
    else:
      print(0)
      sys.exit()
  if cnt == 0:
    ans += 1
  count = 0
  for j in range(len(q)):
    if q[j] % t == 0:
      count +=1
      q.remove(q[j])
      q.appendleft(1)
  for i in range(count):
    q.remove(1)
print(ans)
    

Fixed submission:
import sys 
import numpy as np
from numba import jit
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


@jit(cache=True)
def solve(A):
  count = np.zeros(10**6+10)
  for x in A:
    if count[x] > 1:
      continue
    count[::x] += 1
  ans = 0
  for x in A:
    ans += count[x] == 1
  return ans

N = int(readline())
A = list(map(int,readline().split()))
A = np.array(A)
print(solve(A))