Alice, after mastering the sieve of Eratosthenes, excitedly created a puzzle game that made use of it.
The rules of the puzzle game are as follows:
An array $p_1,p_2,\ldots ,p_N$ is given where all $p_i$ is initially $0$.
A target array $t_1,t_2,\ldots ,t_N$ is given. Her goal is to make $p_i=t_i$ for all $1\le i\le N$.
Each time, she can perform one of the following two operations:
She can repeat this process as much as she wants.
Alice aims to solve the puzzle using the fewest operations, showcasing her puzzle-solving skill. Please help Alice find the minimum number of operations to solve the puzzle.
The first line contains one integer, $N$.
The second line contains space-separated $N$ integers — elements of the array $t$.
Print out the minimum number of operations to solve the puzzle. If the puzzle is unsolvable, print -1.