#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

#define sz(x) (int)(x.size())
#define fr(i,a,b) for(int i=a;i<b;++i)
///////////////////////

int const N = 241;
int const M = 1e7 + 41;

int l[M], a[N], n, b[M];
vector<int> p;
int g[N][N], w[N], lp[N];
vector<int> pt[2];

void sieve(){
	fr(i, 2, M){
		if(l[i] == 0){
			l[i] = i;
			p.push_back(i);
		}
		for(int j=0;j<sz(p) && p[j] * 1LL * i < M && p[j] <= l[i]; ++j){
			l[p[j] * i] = p[j];
		}
	}
}

bool isPrime(int v){
	if(v != 2 && l[v] == v) return true;
	else return false;
}

void clear(){
	fr(i, 0, N) w[i] = 0;
}

bool dfs(int u){
	w[u] = 1;
	fr(i, 0, sz(pt[1])){
		if(g[u][i]){
			if(lp[i] == -1 || !w[lp[i]] && dfs(lp[i])){
				lp[i] = u;
				return true;
			} 
		}
	}
	return false;
}

void solve(){
	sieve();
	cin >> n;
	fr(i, 0, n) cin >> a[i];
	fr(i, 0, n) b[a[i]] = 1;
	fr(i, 1, M){
		if(b[i] != b[i-1]){
			pt[(i&1)].push_back(i);
		}
	}
	fr(i, 0, sz(pt[0])) fr(j, 0, sz(pt[1])){
		int dist = abs(pt[0][i] - pt[1][j]);
		if(isPrime(dist)) g[i][j] = 1;
	}
	fr(i, 0, sz(pt[1])) lp[i] = -1;
	fr(i, 0, sz(pt[0])){
		clear();
		dfs(i);
	}
	int ans = 0;
	int o = sz(pt[1]);
	int e = sz(pt[0]);
	fr(i, 0, sz(pt[1])){
		if(lp[i] != -1) ++ans;
	}
	e -= ans;
	o -= ans;

	ans += (e / 2) * 2;
	ans += (o / 2) * 2;
	e %= 2;
	o %= 2;
	if(o + e > 0) ans += 3;

	cout << ans << endl;
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();

	return 0;
}
### 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<iostream>
#include<algorithm>
#include<vector>

using namespace std;

#define sz(x) (int)(x.size())
#define fr(i,a,b) for(int i=a;i<b;++i)
///////////////////////

int const N = 241;
int const M = 1e7 + 41;

int l[M], a[N], n, b[M];
vector<int> p;
int g[N][N], w[N], lp[N];
vector<int> pt[2];

void sieve(){
	fr(i, 2, M){
		if(l[i] == 0){
			l[i] = i;
			p.push_back(i);
		}
		for(int j=0;j<sz(p) && p[j] * 1LL * i < M && p[j] <= l[i]; ++j){
			l[p[j] * i] = p[j];
		}
	}
}

bool isPrime(int v){
	if(v != 2 && l[v] == v) return true;
	else return false;
}

void clear(){
	fr(i, 0, N) w[i] = 0;
}

bool dfs(int u){
	w[u] = 1;
	fr(i, 0, sz(pt[1])){
		if(g[u][i]){
			if(lp[i] == -1 || !w[lp[i]] && dfs(lp[i])){
				lp[i] = u;
				return true;
			} 
		}
	}
	return false;
}

void solve(){
	sieve();
	cin >> n;
	fr(i, 0, n) cin >> a[i];
	fr(i, 0, n) b[a[i]] = 1;
	fr(i, 1, M){
		if(b[i] != b[i-1]){
			pt[(i&1)].push_back(i);
		}
	}
	fr(i, 0, sz(pt[0])) fr(j, 0, sz(pt[1])){
		int dist = abs(pt[0][i] - pt[1][j]);
		if(isPrime(dist)) g[i][j] = 1;
	}
	fr(i, 0, sz(pt[1])) lp[i] = -1;
	fr(i, 0, sz(pt[0])){
		clear();
		dfs(i);
	}
	int ans = 0;
	int o = sz(pt[1]);
	int e = sz(pt[0]);
	fr(i, 0, sz(pt[1])){
		if(lp[i] != -1) ++ans;
	}
	e -= ans;
	o -= ans;

	ans += (e / 2) * 2;
	ans += (o / 2) * 2;
	e %= 2;
	o %= 2;
	if(o + e > 0) ans += 3;

	cout << ans << endl;
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif

	solve();

	return 0;
}
```