#arc080d. [arc080_d]Prime Flip

[arc080_d]Prime Flip

Problem Statement

There are infinitely many cards, numbered 11, 22, 33, ...... Initially, Cards x1x_1, x2x_2, ......, xNx_N are face up, and the others are face down.

Snuke can perform the following operation repeatedly:

  • Select a prime pp greater than or equal to 33. Then, select pp consecutive cards and flip all of them.

Snuke's objective is to have all the cards face down. Find the minimum number of operations required to achieve the objective.

Constraints

  • 1N1001 ≤ N ≤ 100
  • 1x1<x2<...<xN1071 ≤ x_1 < x_2 < ... < x_N ≤ 10^7

Input

Input is given from Standard Input in the following format:

NN x1x_1 x2x_2 ...... xNx_N

Output

Print the minimum number of operations required to achieve the objective.


Sample Input 1

2
4 5

Sample Output 1

2

Below is one way to achieve the objective in two operations:

  • Select p=5p = 5 and flip Cards 11, 22, 33, 44 and 55.
  • Select p=3p = 3 and flip Cards 11, 22 and 33.

Sample Input 2

9
1 2 3 4 5 6 7 8 9

Sample Output 2

3

Below is one way to achieve the objective in three operations:

  • Select p=3p = 3 and flip Cards 11, 22 and 33.
  • Select p=3p = 3 and flip Cards 44, 55 and 66.
  • Select p=3p = 3 and flip Cards 77, 88 and 99.

Sample Input 3

2
1 10000000

Sample Output 3

4