#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ui unsigned int
#define ull unsigned long long
#define db double
#define ld long double
#define pii pair<ll,int>
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define vii vector<vi>
#define lb lower_bound
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,b,a) for(int i=(b);i>=(a);--i)
#define rep0(i,a,b) for(int i=(a);i<(b);++i)
#define fore(i,a) for(int i=0;i<a.size();++i)
#define gc() getchar()
#define ls x<<1,l,m
#define rs x<<1|1,m+1,r
inline int rd()
{
	int x=0;char c=gc();while(!isdigit(c))c=gc();
	while(isdigit(c))x=x*10+c-48,c=gc();return x;
}
const int N=205,M=1e7+10;
int n,cc,tt,a[N],b[M],vis[M],pr[M],hd[N],vv[N],lk[N];
struct E{int v,nxt;}e[N*N];
inline void add(int u,int v){e[++tt]=(E){v,hd[u]};hd[u]=tt;}
void init(int n)
{
	vis[1]=1;
	rep(i,2,n)
	{
		if(!vis[i])pr[++cc]=i;
		for(int j=1;j<=cc&&1ll*i*pr[j]<=n;j++)
		{
			vis[i*pr[j]]=1;
			if(i%pr[j]==0)break;
		}
	}
	vis[2]=1;
}
bool dfs(int x)
{
	for(int i=hd[x],y;i;i=e[i].nxt)if(!vv[y=e[i].v])
	{
		vv[y]=1;
		if(!lk[y]||dfs(lk[y])){lk[y]=x;return 1;}
	}
	return 0;
}
int main()
{
	init(1e7+5);n=rd();
	rep(i,1,n)a[i]=rd(),b[a[i]]^=1;
	n=0;rep0(i,1,M)if(b[i]!=b[i-1])a[++n]=i;
	int s=0,n1=0,n2=0;
	rep(i,1,n)if(a[i]&1)n1++;else n2++;
	rep(i,1,n)rep(j,i+1,n)if(!vis[abs(a[i]-a[j])])add(i,j),add(j,i);
	rep(i,1,n)if(a[i]&1){memset(vv,0,sizeof(vv));s+=dfs(i);}
	n1-=s;s=n-s+(n1&1);printf("%d\n",s);return 0;
}

### Prompt

Your challenge is to write a CPP solution 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<bits/stdc++.h>
using namespace std;
#define ll long long
#define ui unsigned int
#define ull unsigned long long
#define db double
#define ld long double
#define pii pair<ll,int>
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define vi vector<int>
#define vii vector<vi>
#define lb lower_bound
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define per(i,b,a) for(int i=(b);i>=(a);--i)
#define rep0(i,a,b) for(int i=(a);i<(b);++i)
#define fore(i,a) for(int i=0;i<a.size();++i)
#define gc() getchar()
#define ls x<<1,l,m
#define rs x<<1|1,m+1,r
inline int rd()
{
	int x=0;char c=gc();while(!isdigit(c))c=gc();
	while(isdigit(c))x=x*10+c-48,c=gc();return x;
}
const int N=205,M=1e7+10;
int n,cc,tt,a[N],b[M],vis[M],pr[M],hd[N],vv[N],lk[N];
struct E{int v,nxt;}e[N*N];
inline void add(int u,int v){e[++tt]=(E){v,hd[u]};hd[u]=tt;}
void init(int n)
{
	vis[1]=1;
	rep(i,2,n)
	{
		if(!vis[i])pr[++cc]=i;
		for(int j=1;j<=cc&&1ll*i*pr[j]<=n;j++)
		{
			vis[i*pr[j]]=1;
			if(i%pr[j]==0)break;
		}
	}
	vis[2]=1;
}
bool dfs(int x)
{
	for(int i=hd[x],y;i;i=e[i].nxt)if(!vv[y=e[i].v])
	{
		vv[y]=1;
		if(!lk[y]||dfs(lk[y])){lk[y]=x;return 1;}
	}
	return 0;
}
int main()
{
	init(1e7+5);n=rd();
	rep(i,1,n)a[i]=rd(),b[a[i]]^=1;
	n=0;rep0(i,1,M)if(b[i]!=b[i-1])a[++n]=i;
	int s=0,n1=0,n2=0;
	rep(i,1,n)if(a[i]&1)n1++;else n2++;
	rep(i,1,n)rep(j,i+1,n)if(!vis[abs(a[i]-a[j])])add(i,j),add(j,i);
	rep(i,1,n)if(a[i]&1){memset(vv,0,sizeof(vv));s+=dfs(i);}
	n1-=s;s=n-s+(n1&1);printf("%d\n",s);return 0;
}

```