#include<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
using namespace std;

const int maxn = 2e5+7;
const int maxm = 1e7+7;
int n,a[maxm];
vector<int>v[2],E[maxn];
bool bio[maxn];
int conn[maxn];
void init(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        int x;
        scanf("%d",&x);
        a[x]=1;
    }
}
bool prime(int x){
    if(x==1)return false;
    for(int i=2;i*i<=x;i++)
        if(x%i==0)return false;
    return true;
}
bool dfs(int x){
    if(bio[x])return false;
    bio[x]=true;
    for(auto it : E[x]){
        if(conn[it] == -1 || dfs(conn[it])){
            conn[it] = x;
            return true;
        }
    }
    return false;
}
int main(){
    init();
    memset(conn,-1,sizeof(conn));
    for(int i=maxm-1;i;i--){
        a[i]^=a[i-1];
        if(a[i])v[i%2].push_back(i);
    }
    for(int i=0;i<v[0].size();i++){
        for(int j=0;j<v[1].size();j++){
            if(prime(abs(v[0][i]-v[1][j]))){
                E[i].push_back(j);
            }
        }
    }
    
    int match = 0;
    for(int i=0;i<v[0].size();i++){
        memset(bio,false,sizeof(bio));
        match+=dfs(i);
    }
    cout<<v[0].size()+v[1].size()-match+(v[0].size()-match)%2;
    return 0;
}
### Prompt

Your task is to create 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<iostream>
#include<algorithm>
#include<vector>
#include<string.h>
using namespace std;

const int maxn = 2e5+7;
const int maxm = 1e7+7;
int n,a[maxm];
vector<int>v[2],E[maxn];
bool bio[maxn];
int conn[maxn];
void init(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        int x;
        scanf("%d",&x);
        a[x]=1;
    }
}
bool prime(int x){
    if(x==1)return false;
    for(int i=2;i*i<=x;i++)
        if(x%i==0)return false;
    return true;
}
bool dfs(int x){
    if(bio[x])return false;
    bio[x]=true;
    for(auto it : E[x]){
        if(conn[it] == -1 || dfs(conn[it])){
            conn[it] = x;
            return true;
        }
    }
    return false;
}
int main(){
    init();
    memset(conn,-1,sizeof(conn));
    for(int i=maxm-1;i;i--){
        a[i]^=a[i-1];
        if(a[i])v[i%2].push_back(i);
    }
    for(int i=0;i<v[0].size();i++){
        for(int j=0;j<v[1].size();j++){
            if(prime(abs(v[0][i]-v[1][j]))){
                E[i].push_back(j);
            }
        }
    }
    
    int match = 0;
    for(int i=0;i<v[0].size();i++){
        memset(bio,false,sizeof(bio));
        match+=dfs(i);
    }
    cout<<v[0].size()+v[1].size()-match+(v[0].size()-match)%2;
    return 0;
}
```