J. Weird Sanchola
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Sanchola is getting an array of integers as gift. He's weird, so he doesn't like having distinct integers in the same array and he only likes prime numbers. That's why he believes that he might need to fix the array after receiving it by turning all elements into the same prime number.

Sanchola is also very lazy and wants to do that using the minimum number of operations. In one operation Sanchola can either increase or decrease a single element of the array by one.

Given the array that he received as a gift, help Sanchola figuring out the minimum number of operations required to fix the array.

Input

The first line contains a single integer $$$N$$$ $$$(1 \leq N \leq 10^{5})$$$, indicating the length of the array.

The second line contains $$$N$$$ integers $$$a_{1}$$$, $$$a_{2}$$$, ..., $$$a_{n}$$$ $$$(1 \leq N \leq 10^{9})$$$, indicating the elements of the array $$$a$$$.

Output

In a single line output the minimum number of operations to satisfy Sanchola.

Examples
Input
3
2 3 10
Output
8
Input
2
1 1000000000
Output
999999999
Input
4
3 5 7 11
Output
10