http://acm.hdu.edu.cn/showproblem.php?pid=2138
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
bool isprime(int m)
{
if(m == 1)
return 0;
int n=sqrt((double)m);
for(int i=2; i<=n; i++)
if(m%i == 0)
return 1;
return 0;
}
int main()
{
int m,n;
while(~scanf("%d",&m))
{
int sum=0;
while(m--)
{
scanf("%d",&n);
if(!isprime(n))
sum++;
}
printf("%d\n",sum);
}
return 0;
}