#include <iostream>
using namespace std;
bool prim(int n) {
for (int i = 2; i <= n / 2; i++) {
if (n%i == 0)
return 0;
}
return 1;
}
int main() {
int n, suma, contor =0;
cin >> n;
int sir[100];
cout << "Introduceti numerele :";
for (int i = 0; i < n; i++) {
cin >> sir[i];
}
for (int j = 0; j < n; j++) {
for (int k = 0; k < n; k++) {
suma = sir[j] + sir[k];
if (prim(suma))
contor++;
}
}
cout << endl << contor;
}