output_description: Print the answer.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 \cdots A_N
attempt: from itertools import combinations
  from operator import mul
  from functools import reduce
  from collections import Counter
  
  
  class Osa_k:
      def __init__(self, n_max):
          self.n_max = n_max
          self.min_factor = min_factor = list(range(n_max + 1))
          min_factor[2::2] = [2] * (n_max // 2)
          min_factor[3::6] = [3] * ((n_max + 3) // 6)
          for i in range(5, int(n_max**0.5) + 1, 2):
              if min_factor[i] == i:
                  for j in range(i * i, n_max + 1, i):
                      if min_factor[j] == j:
                          min_factor[j] = i
  
      def __call__(self, n):
          if not 1 <= n <= self.n_max:
              raise ValueError("Invaild Value!")
          min_factor = self.min_factor
          n_twoes = (n & -n).bit_length() - 1
          res = [2] * n_twoes
          n >>= n_twoes
          resappend = res.append
          while n > 1:
              p = min_factor[n]
              resappend(p)
              n //= p
          return res
  
      def d(self, n):
          min_factor = self.min_factor
          t = []
          tappend = t.append
          while n > 1:
              if t and t[-1][0] == min_factor[n]:
                  t[-1][1] += 1
              else:
                  tappend([min_factor[n], 1])
              n //= min_factor[n]
          res = 1
          for _, i in t:
              res *= i + 1
          return res
  
      def div(self, n):
          factors = self.__call__(n)
          res = {1, n}
          for i in range(1, len(factors)):
              for j in combinations(factors, i):
                  res |= {reduce(mul, j)}
          return res
  
  
  n, *a = map(int, open(0).read().split())
  b = set(a)
  P = Osa_k(max(b))
  cnt = n == 1
  for i, j in Counter(a).items():
      cnt += j == 1 and all(d not in b for d in P.div(i) if d != 1)
  print(cnt)
  
problem_description: Statement
  
  Given is a number sequence A of length N.
  
  Find the number of integers i \left(1 \leq i \leq N\right) with the following
  property:
  
    * For every integer j \left(1 \leq j \leq N\right) such that i \neq j , A_j does not divide A_i.
samples: [{"input": "5\n    24 11 8 3 16", "output": "3\n    \n\nThe integers with the property are 2, 3, and 4.\n\n* * *"}, {"input": "4\n    5 5 5 5", "output": "0\n    \n\nNote that there can be multiple equal numbers.\n\n* * *"}, {"input": "10\n    33 18 45 28 8 19 89 86 2 4", "output": "5"}]