#include<iostream>
using namespace std;
int main()
{ int n,v[100],d=1,p=0,i,k=0,max1=0,min1=99999;
cin>>n;
for(i=0;i<n;i++)
{cin>>v[i];}
for(i=0;i<n;i++)
{ if(v[i]==1)
{i++;}
while(d<=v[i])
{ if(v[i]%d==0)
{p++;}
d++;
}
if(p==2)
k++;
{if(v[i]>max1)
{max1=v[i];}
if(v[i]<min1)
{min1=v[i];}}
p=0;
d=1;}
cout<<k<<endl;
cout<<min1<<endl;
cout<<max1<<endl;
}