#include <bits/stdc++.h>
#define N 205

using namespace std;

int n;
int a[N];
int b[N], tot;

inline int read() {
	int x = 0; char ch = getchar();
	while(!isdigit(ch)) ch = getchar();
	while(isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
	return x;
}

bool vis[N];
int match[N];

bool isPrime(int x) { // except 2
	if(x == 1 || (~x & 1)) return false;
	for(int i = 3; i * i <= x; ++i)
		if(x % i == 0)
			return false;
	return true;
}

bool dfs(int u) {
	for(int i = 1; i <= tot; ++i) {
		if(u == i || vis[i] || !isPrime(abs(b[i] - b[u])))
			continue;
		vis[i] = true;
		if(!match[i] || dfs(match[i])) {
			match[i] = u;
			return true;
		}
	}
	return false;
}

int main() {
	n = read();
	for(int i = 1; i <= n; ++i) a[i] = read();
	sort(a + 1, a + n + 1);
	a[0] = a[1] - N, a[n + 1] = a[n] + N;
	for(int i = 1; i <= n; ++i) {
		if(a[i - 1] + 1 != a[i])
			b[++tot] = a[i];
		if(a[i] + 1 != a[i + 1])
			b[++tot] = a[i] + 1;
	}
	
	int ans(0);
	int even = 0, odd = 0;
	for(int i = 1; i <= tot; ++i) {
		if(~b[i] & 1) {
			++even;
			continue;
		}
		++odd;
		memset(vis, 0, sizeof vis);
		if(dfs(i)) {
			cerr << "ERR" << endl;
			++ans;
			--even;
			--odd;
		}
	}

	ans += (even) / 2 * 2;
	ans += (odd) / 2 * 2;
	ans += (even & 1) * 3;
	printf("%d\n", ans);
	return 0;
}
### Prompt

Construct a cpp code solution to the problem outlined:

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>
#define N 205

using namespace std;

int n;
int a[N];
int b[N], tot;

inline int read() {
	int x = 0; char ch = getchar();
	while(!isdigit(ch)) ch = getchar();
	while(isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
	return x;
}

bool vis[N];
int match[N];

bool isPrime(int x) { // except 2
	if(x == 1 || (~x & 1)) return false;
	for(int i = 3; i * i <= x; ++i)
		if(x % i == 0)
			return false;
	return true;
}

bool dfs(int u) {
	for(int i = 1; i <= tot; ++i) {
		if(u == i || vis[i] || !isPrime(abs(b[i] - b[u])))
			continue;
		vis[i] = true;
		if(!match[i] || dfs(match[i])) {
			match[i] = u;
			return true;
		}
	}
	return false;
}

int main() {
	n = read();
	for(int i = 1; i <= n; ++i) a[i] = read();
	sort(a + 1, a + n + 1);
	a[0] = a[1] - N, a[n + 1] = a[n] + N;
	for(int i = 1; i <= n; ++i) {
		if(a[i - 1] + 1 != a[i])
			b[++tot] = a[i];
		if(a[i] + 1 != a[i + 1])
			b[++tot] = a[i] + 1;
	}
	
	int ans(0);
	int even = 0, odd = 0;
	for(int i = 1; i <= tot; ++i) {
		if(~b[i] & 1) {
			++even;
			continue;
		}
		++odd;
		memset(vis, 0, sizeof vis);
		if(dfs(i)) {
			cerr << "ERR" << endl;
			++ans;
			--even;
			--odd;
		}
	}

	ans += (even) / 2 * 2;
	ans += (odd) / 2 * 2;
	ans += (even & 1) * 3;
	printf("%d\n", ans);
	return 0;
}
```