#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 205
#define M 10000002
bool cf[M+5],vis[M+5];
int prime[M+5],tot;
int cy[N],a[N],b[N],cntx,cnty;
bool vs[N],c[N][N];
void shai()
{
	vis[1]=1;int i,j;
	for(i=1;i<=M;i++){
		if(!vis[i])prime[++tot]=i;
		for(j=1;j<=tot;j++){
			int tmp=i*prime[j];
			if(tmp>M)break;
			vis[tmp]=1;
			if(i%prime[j]==0)break;
		}
		if(cf[i]){
			if(i&1)a[++cntx]=i;
			else b[++cnty]=i;
		}
	}
}
//pay attention to vs
bool dfs(int i)
{
	for(int j=1;j<=cnty;j++){
		if(c[i][j]&&!vs[j]){
			vs[j]=1;
			if(!cy[j]||dfs(cy[j])){
				cy[j]=i;
				return 1;
			}
		}
	}
	return 0;
}
int maxmatch()
{
	memset(cy,0,sizeof(cy));
	int ret=0;
	for(int i=1;i<=cntx;i++){
		memset(vs,0,sizeof(vs));
		if(dfs(i))ret++;
	}
	return ret;
}
int ab(int x){return x<0?-x:x;}
int main()
{
	int n,i,j,x,ans;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&x);
		cf[x]^=1;cf[x+1]^=1;
	}
	shai();
	for(i=1;i<=cntx;i++)
		for(j=1;j<=cnty;j++)
			if(!vis[ab(b[j]-a[i])])c[i][j]=1;
	ans=maxmatch();
	cntx-=ans;cnty-=ans;
	ans+=(cntx/2)*2+(cnty/2)*2;
	if(cntx%2==1&&cnty%2==1)ans+=3;
	printf("%d",ans);
}
### Prompt

Please create a solution in Cpp to the following problem:

There are infinitely many cards, numbered 1, 2, 3, ... Initially, Cards x_1, x_2, ..., x_N are face up, and the others are face down.

Snuke can perform the following operation repeatedly:

* Select a prime p greater than or equal to 3. Then, select p 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

* 1 ≤ N ≤ 100
* 1 ≤ x_1 < x_2 < ... < x_N ≤ 10^7

Input

Input is given from Standard Input in the following format:


N
x_1 x_2 ... x_N


Output

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

Examples

Input

2
4 5


Output

2


Input

9
1 2 3 4 5 6 7 8 9


Output

3


Input

2
1 10000000


Output

4

### Response

```cpp
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 205
#define M 10000002
bool cf[M+5],vis[M+5];
int prime[M+5],tot;
int cy[N],a[N],b[N],cntx,cnty;
bool vs[N],c[N][N];
void shai()
{
	vis[1]=1;int i,j;
	for(i=1;i<=M;i++){
		if(!vis[i])prime[++tot]=i;
		for(j=1;j<=tot;j++){
			int tmp=i*prime[j];
			if(tmp>M)break;
			vis[tmp]=1;
			if(i%prime[j]==0)break;
		}
		if(cf[i]){
			if(i&1)a[++cntx]=i;
			else b[++cnty]=i;
		}
	}
}
//pay attention to vs
bool dfs(int i)
{
	for(int j=1;j<=cnty;j++){
		if(c[i][j]&&!vs[j]){
			vs[j]=1;
			if(!cy[j]||dfs(cy[j])){
				cy[j]=i;
				return 1;
			}
		}
	}
	return 0;
}
int maxmatch()
{
	memset(cy,0,sizeof(cy));
	int ret=0;
	for(int i=1;i<=cntx;i++){
		memset(vs,0,sizeof(vs));
		if(dfs(i))ret++;
	}
	return ret;
}
int ab(int x){return x<0?-x:x;}
int main()
{
	int n,i,j,x,ans;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&x);
		cf[x]^=1;cf[x+1]^=1;
	}
	shai();
	for(i=1;i<=cntx;i++)
		for(j=1;j<=cnty;j++)
			if(!vis[ab(b[j]-a[i])])c[i][j]=1;
	ans=maxmatch();
	cntx-=ans;cnty-=ans;
	ans+=(cntx/2)*2+(cnty/2)*2;
	if(cntx%2==1&&cnty%2==1)ans+=3;
	printf("%d",ans);
}
```