#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n, x, i, prim, d, maxi = -10000, mini = 1000000000, k = 0;
cin>>n;
for(i = 1; i <= n; i++)
{
cin>>x;
prim = 1;
if(x == 2 || x % 2 != 0 && x > 2)
{
for(d = 3; d <= sqrt(x) && prim == 1; d += 2)
if(x % d == 0)
prim = 0;
if(prim)
{
k++;
if(x < mini) mini = x;
if(x > maxi) maxi = x;
}
}
}
cout<<k<<" "<<mini<<" "<<maxi;
return 0;
}