#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define poly vector<ll>
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
inline ll read(){
	ll x=0;char ch=getchar();bool d=1;
	for(;!isdigit(ch);ch=getchar()) if(ch=='-') d=0;
	for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	return d?x:-x;
}
inline void write(ll x){
	if(x<0) x=-x,putchar('-');
	if(x>=10) write(x/10);
	putchar('0'+x%10);
}
inline void writeln(ll x){write(x);puts("");}
inline void writep(ll x){write(x);putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=205;
int head[N],opt;
struct info{
	int to,nxt;
}e[N*N*2];
void add(int x,int y){
	e[++opt]=(info){y,head[x]};head[x]=opt;
	e[++opt]=(info){x,head[y]};head[y]=opt;
}
bool check(int x){
	if(x<=2) return 0;
	for(int i=2;i*i<=x;i++){
		if(x%i==0) return 0;
	}
	return 1;
}
int ma[N];
bool used[N];
bool dfs(int u){
	for(int i=head[u];i;i=e[i].nxt){
		int k=e[i].to;
		if(used[k]) continue;
		used[k]=1;
		if(!ma[k]||dfs(ma[k])) return ma[k]=u,1;
	}
	return 0;
}
int a[N],pos[N];
int main(){
	// freopen("ssw.in","r",stdin);
	int n=read(),m=0,cnt=0;
	For(i,1,n){
		a[i]=read();
		if(i==1||a[i-1]<a[i]-1) pos[++m]=a[i];
		if(i>1&&a[i-1]+1<a[i]) pos[++m]=a[i-1]+1;
	}
	pos[++m]=a[n]+1;
	sort(pos+1,pos+m+1);
	For(i,1,m) cerr<<pos[i]<<endl;
	For(i,1,m) if(pos[i]&1) cnt++;
	For(i,1,m) For(j,i+1,m){
		if(check(pos[j]-pos[i])) add(i,j);
	}
	int ssw=0;
	For(i,1,m) if(pos[i]%2==0){
		memset(used,0,sizeof(used));
		ssw+=dfs(i);
	}
	cout<<ssw+(m-ssw*2)+(cnt-ssw)%2;
}
### Prompt

Create a solution in cpp for 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 ld long double
#define ull unsigned long long
#define poly vector<ll>
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
inline ll read(){
	ll x=0;char ch=getchar();bool d=1;
	for(;!isdigit(ch);ch=getchar()) if(ch=='-') d=0;
	for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	return d?x:-x;
}
inline void write(ll x){
	if(x<0) x=-x,putchar('-');
	if(x>=10) write(x/10);
	putchar('0'+x%10);
}
inline void writeln(ll x){write(x);puts("");}
inline void writep(ll x){write(x);putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=205;
int head[N],opt;
struct info{
	int to,nxt;
}e[N*N*2];
void add(int x,int y){
	e[++opt]=(info){y,head[x]};head[x]=opt;
	e[++opt]=(info){x,head[y]};head[y]=opt;
}
bool check(int x){
	if(x<=2) return 0;
	for(int i=2;i*i<=x;i++){
		if(x%i==0) return 0;
	}
	return 1;
}
int ma[N];
bool used[N];
bool dfs(int u){
	for(int i=head[u];i;i=e[i].nxt){
		int k=e[i].to;
		if(used[k]) continue;
		used[k]=1;
		if(!ma[k]||dfs(ma[k])) return ma[k]=u,1;
	}
	return 0;
}
int a[N],pos[N];
int main(){
	// freopen("ssw.in","r",stdin);
	int n=read(),m=0,cnt=0;
	For(i,1,n){
		a[i]=read();
		if(i==1||a[i-1]<a[i]-1) pos[++m]=a[i];
		if(i>1&&a[i-1]+1<a[i]) pos[++m]=a[i-1]+1;
	}
	pos[++m]=a[n]+1;
	sort(pos+1,pos+m+1);
	For(i,1,m) cerr<<pos[i]<<endl;
	For(i,1,m) if(pos[i]&1) cnt++;
	For(i,1,m) For(j,i+1,m){
		if(check(pos[j]-pos[i])) add(i,j);
	}
	int ssw=0;
	For(i,1,m) if(pos[i]%2==0){
		memset(used,0,sizeof(used));
		ssw+=dfs(i);
	}
	cout<<ssw+(m-ssw*2)+(cnt-ssw)%2;
}
```