atcoder#ABC170D. [ABC170D] Not Divisible

[ABC170D] Not Divisible

Score : 400400 points

Problem Statement

Given is a number sequence AA of length NN.

Find the number of integers ii (1iN)\left(1 \leq i \leq N\right) with the following property:

  • For every integer jj (1jN)\left(1 \leq j \leq N\right) such that iji \neq j, AjA_j does not divide AiA_i.

Constraints

  • All values in input are integers.
  • 1N2×1051 \leq N \leq 2 \times 10^5
  • 1Ai1061 \leq A_i \leq 10^6

Input

Input is given from Standard Input in the following format:

NN

A1A_1 A2A_2 \cdots ANA_N

Output

Print the answer.

5
24 11 8 3 16
3

The integers with the property are 22, 33, and 44.

4
5 5 5 5
0

Note that there can be multiple equal numbers.

10
33 18 45 28 8 19 89 86 2 4
5