stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<math.h>

using namespace std;

int n,tot=0,temp;

bool m[10005];

bool pri(int mt){

	for(int i=2;i<=(int)sqrt(mt);i++){

		if(mt%i==0){

			return 0;

		}

	}

	return 1;

}

int main(void){

	scanf("%d",&n);

	for(int i=0;i<n;i++){

		scanf("%d",&temp);

		if(temp>2){

			if(pri(temp)){

				tot++;

			}

		}

		else if(temp==2){

			tot++;

		}

		else if(temp==1||temp==0){

		}

	}

	printf("%d\n",tot);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.181215626328395x):
#include<cstdio>

int isPrime(int x){

int i;

if(x<2)return 0;

else if(x==2)return 1;

if(x%2==0)return 0;

for(i=3;i*i<=x;i+=2){

if(x%i==0)return 0;

}

return 1;

}

int main(){

int n,x,i;

int cnt=0;

scanf("%d",&n);

for(i=0;i<n;i++){

scanf("%d",&x);

if(isPrime(x))cnt++;

}

printf("%d\n",cnt);

return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

int pr[10000001]= {0};

int main()

{

    int i,j,k,s,d,r,n,h,l,x,y,z,g;





    scanf("%d",&g);

    s=0;

   for(h=1; h<=g; h++)

   {

        scanf("%d",&n);





            d=0;

            r=sqrt(n);

            if(n%2==0) d++;

            for(i=3; i<=r; i+=2)

            {

                if(n%i==0) d++;

                if(d>0) break;

            }



            if(n==2) s++;



            else if(d==0) s++;

            







   }

     printf("%d\n",s);





    return 0;



}

// Faster C++ solution for the same problem (measured speedup: 5.181677408005712x):
#include<cstdio>

int isPrime(int x){

int i;

if(x<2)return 0;

else if(x==2)return 1;

if(x%2==0)return 0;

for(i=3;i*i<=x;i+=2){

if(x%i==0)return 0;

}

return 1;

}

int main(){

int n,x,i;

int cnt=0;

scanf("%d",&n);

for(i=0;i<n;i++){

scanf("%d",&x);

if(isPrime(x))cnt++;

}

printf("%d\n",cnt);

return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cmath>

using namespace std;

bool f(int n){

    int cnt=0;

    for(int i=2;i<=sqrt(n);i++){

        if(n%i==0)

            cnt++;

    }

    if(cnt==0)

        return true;

    return false;

}

int main(){

    int n,m,cnt=0;

    cin>>n;

    for(int i=0;i<n;i++){

        cin>>m;

        if(f(m))

            cnt++;

        

    }

    cout<<cnt<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.207745455788988x):
#include<cstdio>

int isPrime(int x){

int i;

if(x<2)return 0;

else if(x==2)return 1;

if(x%2==0)return 0;

for(i=3;i*i<=x;i+=2){

if(x%i==0)return 0;

}

return 1;

}

int main(){

int n,x,i;

int cnt=0;

scanf("%d",&n);

for(i=0;i<n;i++){

scanf("%d",&x);

if(isPrime(x))cnt++;

}

printf("%d\n",cnt);

return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int n,k,t=0;

bool prime(int o)

{

    if(o<2)return false;

    for(int i=2;i*i<=o;i++)if(o%i==0)return false;

    return true;

}

int main()

{

    cin>>n;

    while(n--)

    {

        cin>>k;

        if(prime(k))t++;

    }

    cout<<t<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.168779770532938x):
#include<cstdio>

int isPrime(int x){

int i;

if(x<2)return 0;

else if(x==2)return 1;

if(x%2==0)return 0;

for(i=3;i*i<=x;i+=2){

if(x%i==0)return 0;

}

return 1;

}

int main(){

int n,x,i;

int cnt=0;

scanf("%d",&n);

for(i=0;i<n;i++){

scanf("%d",&x);

if(isPrime(x))cnt++;

}

printf("%d\n",cnt);

return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<algorithm>

#include<math.h>

using namespace std;

int a[10001];

int main()

{

    int n,b,c,m=0;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

        scanf("%d",&a[i]);

    for(int i=1;i<=n;i++)

 {   if(a[i]==1)continue;

   else

   {

     int t=0;

    b=sqrt(a[i]);

    for(int j=2;j<=b;j++)

    if(a[i]%j==0)t++;

    if(t==0)m++;

   }

 }

    printf("%d\n",m);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.19130703536667x):
#include <stdio.h>



bool is_prime(int n)

{

	for (int i = 2; i * i <= n; i++)

		if (n % i == 0)

			return false;

	return true;

}



int main()

{

	int N, n, k = 0;

	scanf("%d", &N);

	while (N--)

	{

		scanf("%d", &n);

		if (is_prime(n))

			k++;

	}

	printf("%d\n", k);



	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<string.h>

using namespace std;



bool isprime(int k)

{

    if(k<2) return 0;

    else if(k==2) return 1;

    if(k%2==0) return 0;

    for(int i=3;i*i<=k;i+=2)

    {

        if(k%i==0) return 0;

    }

    return 1;

}



int main()

{

	int n,m,ans=0;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&m);

		if(isprime(m)) ans++;

	}

	printf("%d\n",ans);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.149351842402178x):
#include <stdio.h>



bool is_prime(int n)

{

	for (int i = 2; i * i <= n; i++)

		if (n % i == 0)

			return false;

	return true;

}



int main()

{

	int N, n, k = 0;

	scanf("%d", &N);

	while (N--)

	{

		scanf("%d", &n);

		if (is_prime(n))

			k++;

	}

	printf("%d\n", k);



	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<vector>

#include <algorithm>



using namespace std;

vector<int> n;



int main(void)

{

    int count,temp,ans=0,rant=0;



    cin>>count;

    for(int i=0;i<count;i++)

    {

        cin>>temp;

        rant=rant>temp?rant:temp;

        n.push_back(temp);

    }



  vector<bool> pri(++rant,0);



   for(int i=2;i*i<rant;i++)

  {

      if(!pri.at(i))

         {



             for(int j=i;j*i<rant;j++)

                {

                   pri[i*j]=true;

                }

         }

  }



    for(int i=0;i<count;i++)

    {

        if(!pri.at(n.at(i)))

            ans++;

    }



  cout<<ans<<endl;

return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.279732841012118x):
#include <stdio.h>



bool is_prime(int n)

{

	for (int i = 2; i * i <= n; i++)

		if (n % i == 0)

			return false;

	return true;

}



int main()

{

	int N, n, k = 0;

	scanf("%d", &N);

	while (N--)

	{

		scanf("%d", &n);

		if (is_prime(n))

			k++;

	}

	printf("%d\n", k);



	return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<math.h>

using namespace std;

int n,tot=0,temp;

bool m[10005];

bool pri(int mt){

	for(int i=2;i<=(int)sqrt(mt);i++){

		if(mt%i==0){

			return 0;

		}

	}

	return 1;

}

int main(void){

	scanf("%d",&n);

	for(int i=0;i<n;i++){

		scanf("%d",&temp);

		if(temp>2){

			if(pri(temp)){

				tot++;

			}

		}

		else if(temp==2){

			tot++;

		}

		else if(temp==1||temp==0){

		}

	}

	printf("%d\n",tot);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.189175765289319x):
#include <stdio.h>



bool is_prime(int n)

{

	for (int i = 2; i * i <= n; i++)

		if (n % i == 0)

			return false;

	return true;

}



int main()

{

	int N, n, k = 0;

	scanf("%d", &N);

	while (N--)

	{

		scanf("%d", &n);

		if (is_prime(n))

			k++;

	}

	printf("%d\n", k);



	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

int pr[10000001]= {0};

int main()

{

    int i,j,k,s,d,r,n,h,l,x,y,z,g;





    scanf("%d",&g);

    s=0;

   for(h=1; h<=g; h++)

   {

        scanf("%d",&n);





            d=0;

            r=sqrt(n);

            if(n%2==0) d++;

            for(i=3; i<=r; i+=2)

            {

                if(n%i==0) d++;

                if(d>0) break;

            }



            if(n==2) s++;



            else if(d==0) s++;

            







   }

     printf("%d\n",s);





    return 0;



}

// Faster C++ solution for the same problem (measured speedup: 5.1896382564229855x):
#include <stdio.h>



bool is_prime(int n)

{

	for (int i = 2; i * i <= n; i++)

		if (n % i == 0)

			return false;

	return true;

}



int main()

{

	int N, n, k = 0;

	scanf("%d", &N);

	while (N--)

	{

		scanf("%d", &n);

		if (is_prime(n))

			k++;

	}

	printf("%d\n", k);



	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cmath>

using namespace std;

bool f(int n){

    int cnt=0;

    for(int i=2;i<=sqrt(n);i++){

        if(n%i==0)

            cnt++;

    }

    if(cnt==0)

        return true;

    return false;

}

int main(){

    int n,m,cnt=0;

    cin>>n;

    for(int i=0;i<n;i++){

        cin>>m;

        if(f(m))

            cnt++;

        

    }

    cout<<cnt<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.215746353742462x):
#include <stdio.h>



bool is_prime(int n)

{

	for (int i = 2; i * i <= n; i++)

		if (n % i == 0)

			return false;

	return true;

}



int main()

{

	int N, n, k = 0;

	scanf("%d", &N);

	while (N--)

	{

		scanf("%d", &n);

		if (is_prime(n))

			k++;

	}

	printf("%d\n", k);



	return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int n,k,t=0;

bool prime(int o)

{

    if(o<2)return false;

    for(int i=2;i*i<=o;i++)if(o%i==0)return false;

    return true;

}

int main()

{

    cin>>n;

    while(n--)

    {

        cin>>k;

        if(prime(k))t++;

    }

    cout<<t<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.176720803718814x):
#include <stdio.h>



bool is_prime(int n)

{

	for (int i = 2; i * i <= n; i++)

		if (n % i == 0)

			return false;

	return true;

}



int main()

{

	int N, n, k = 0;

	scanf("%d", &N);

	while (N--)

	{

		scanf("%d", &n);

		if (is_prime(n))

			k++;

	}

	printf("%d\n", k);



	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<algorithm>

#include<math.h>

using namespace std;

int a[10001];

int main()

{

    int n,b,c,m=0;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

        scanf("%d",&a[i]);

    for(int i=1;i<=n;i++)

 {   if(a[i]==1)continue;

   else

   {

     int t=0;

    b=sqrt(a[i]);

    for(int j=2;j<=b;j++)

    if(a[i]%j==0)t++;

    if(t==0)m++;

   }

 }

    printf("%d\n",m);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.797222919852947x):
#include<cstdio>

#include<cmath>

bool isp(int nu){

	int i = 1;

	if(nu == 1) return false;

	else if(nu == 2) return 1;

	int sqr = sqrt(nu) + 1;

	for(i = 2;i <= sqr;i++) if(nu % i == 0) return false;

	return true;

}

int main(){

    short sum=0, n;

    scanf("%d", &n);

    for(;n>0;n--){

        int temp;

        scanf("%d", &temp);

        if(isp(temp)) sum++;

    }

    printf("%d\n", sum);

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<string.h>

using namespace std;



bool isprime(int k)

{

    if(k<2) return 0;

    else if(k==2) return 1;

    if(k%2==0) return 0;

    for(int i=3;i*i<=k;i+=2)

    {

        if(k%i==0) return 0;

    }

    return 1;

}



int main()

{

	int n,m,ans=0;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&m);

		if(isprime(m)) ans++;

	}

	printf("%d\n",ans);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.7584526425557385x):
#include<cstdio>

#include<cmath>

bool isp(int nu){

	int i = 1;

	if(nu == 1) return false;

	else if(nu == 2) return 1;

	int sqr = sqrt(nu) + 1;

	for(i = 2;i <= sqr;i++) if(nu % i == 0) return false;

	return true;

}

int main(){

    short sum=0, n;

    scanf("%d", &n);

    for(;n>0;n--){

        int temp;

        scanf("%d", &temp);

        if(isp(temp)) sum++;

    }

    printf("%d\n", sum);

}
// Slower C++ solution:
#include<iostream>

#include<vector>

#include <algorithm>



using namespace std;

vector<int> n;



int main(void)

{

    int count,temp,ans=0,rant=0;



    cin>>count;

    for(int i=0;i<count;i++)

    {

        cin>>temp;

        rant=rant>temp?rant:temp;

        n.push_back(temp);

    }



  vector<bool> pri(++rant,0);



   for(int i=2;i*i<rant;i++)

  {

      if(!pri.at(i))

         {



             for(int j=i;j*i<rant;j++)

                {

                   pri[i*j]=true;

                }

         }

  }



    for(int i=0;i<count;i++)

    {

        if(!pri.at(n.at(i)))

            ans++;

    }



  cout<<ans<<endl;

return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.878936118216843x):
#include<cstdio>

#include<cmath>

bool isp(int nu){

	int i = 1;

	if(nu == 1) return false;

	else if(nu == 2) return 1;

	int sqr = sqrt(nu) + 1;

	for(i = 2;i <= sqr;i++) if(nu % i == 0) return false;

	return true;

}

int main(){

    short sum=0, n;

    scanf("%d", &n);

    for(;n>0;n--){

        int temp;

        scanf("%d", &temp);

        if(isp(temp)) sum++;

    }

    printf("%d\n", sum);

}
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<math.h>

using namespace std;

int n,tot=0,temp;

bool m[10005];

bool pri(int mt){

	for(int i=2;i<=(int)sqrt(mt);i++){

		if(mt%i==0){

			return 0;

		}

	}

	return 1;

}

int main(void){

	scanf("%d",&n);

	for(int i=0;i<n;i++){

		scanf("%d",&temp);

		if(temp>2){

			if(pri(temp)){

				tot++;

			}

		}

		else if(temp==2){

			tot++;

		}

		else if(temp==1||temp==0){

		}

	}

	printf("%d\n",tot);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.795253439413087x):
#include<cstdio>

#include<cmath>

bool isp(int nu){

	int i = 1;

	if(nu == 1) return false;

	else if(nu == 2) return 1;

	int sqr = sqrt(nu) + 1;

	for(i = 2;i <= sqr;i++) if(nu % i == 0) return false;

	return true;

}

int main(){

    short sum=0, n;

    scanf("%d", &n);

    for(;n>0;n--){

        int temp;

        scanf("%d", &temp);

        if(isp(temp)) sum++;

    }

    printf("%d\n", sum);

}
// Slower C++ solution:
#include<bits/stdc++.h>

int pr[10000001]= {0};

int main()

{

    int i,j,k,s,d,r,n,h,l,x,y,z,g;





    scanf("%d",&g);

    s=0;

   for(h=1; h<=g; h++)

   {

        scanf("%d",&n);





            d=0;

            r=sqrt(n);

            if(n%2==0) d++;

            for(i=3; i<=r; i+=2)

            {

                if(n%i==0) d++;

                if(d>0) break;

            }



            if(n==2) s++;



            else if(d==0) s++;

            







   }

     printf("%d\n",s);





    return 0;



}

// Faster C++ solution for the same problem (measured speedup: 4.79568082177586x):
#include<cstdio>

#include<cmath>

bool isp(int nu){

	int i = 1;

	if(nu == 1) return false;

	else if(nu == 2) return 1;

	int sqr = sqrt(nu) + 1;

	for(i = 2;i <= sqr;i++) if(nu % i == 0) return false;

	return true;

}

int main(){

    short sum=0, n;

    scanf("%d", &n);

    for(;n>0;n--){

        int temp;

        scanf("%d", &temp);

        if(isp(temp)) sum++;

    }

    printf("%d\n", sum);

}
// Slower C++ solution:
#include <iostream>

#include <cmath>

using namespace std;

bool f(int n){

    int cnt=0;

    for(int i=2;i<=sqrt(n);i++){

        if(n%i==0)

            cnt++;

    }

    if(cnt==0)

        return true;

    return false;

}

int main(){

    int n,m,cnt=0;

    cin>>n;

    for(int i=0;i<n;i++){

        cin>>m;

        if(f(m))

            cnt++;

        

    }

    cout<<cnt<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.81980699308522x):
#include<cstdio>

#include<cmath>

bool isp(int nu){

	int i = 1;

	if(nu == 1) return false;

	else if(nu == 2) return 1;

	int sqr = sqrt(nu) + 1;

	for(i = 2;i <= sqr;i++) if(nu % i == 0) return false;

	return true;

}

int main(){

    short sum=0, n;

    scanf("%d", &n);

    for(;n>0;n--){

        int temp;

        scanf("%d", &temp);

        if(isp(temp)) sum++;

    }

    printf("%d\n", sum);

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int n,k,t=0;

bool prime(int o)

{

    if(o<2)return false;

    for(int i=2;i*i<=o;i++)if(o%i==0)return false;

    return true;

}

int main()

{

    cin>>n;

    while(n--)

    {

        cin>>k;

        if(prime(k))t++;

    }

    cout<<t<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.78374396276205x):
#include<cstdio>

#include<cmath>

bool isp(int nu){

	int i = 1;

	if(nu == 1) return false;

	else if(nu == 2) return 1;

	int sqr = sqrt(nu) + 1;

	for(i = 2;i <= sqr;i++) if(nu % i == 0) return false;

	return true;

}

int main(){

    short sum=0, n;

    scanf("%d", &n);

    for(;n>0;n--){

        int temp;

        scanf("%d", &temp);

        if(isp(temp)) sum++;

    }

    printf("%d\n", sum);

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<algorithm>

#include<math.h>

using namespace std;

int a[10001];

int main()

{

    int n,b,c,m=0;

    scanf("%d",&n);

    for(int i=1;i<=n;i++)

        scanf("%d",&a[i]);

    for(int i=1;i<=n;i++)

 {   if(a[i]==1)continue;

   else

   {

     int t=0;

    b=sqrt(a[i]);

    for(int j=2;j<=b;j++)

    if(a[i]%j==0)t++;

    if(t==0)m++;

   }

 }

    printf("%d\n",m);

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.799518524029535x):
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

using namespace std;



int main()

{

    int n, i, j, pnum = 0;

    int l;

    scanf("%d", &n);

    for(i = 0; i<n ; i++)

    {

        scanf("%d", &l);

        for(j = 2; j<= sqrt(l)&&(int)l%j != 0; j++);

        if(j == (int)sqrt(l)+1 || l == 2 || l == 3 || l ==5 || l == 7)

            pnum++;

    }

    printf("%d\n", pnum);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<stdio.h>

#include<string.h>

using namespace std;



bool isprime(int k)

{

    if(k<2) return 0;

    else if(k==2) return 1;

    if(k%2==0) return 0;

    for(int i=3;i*i<=k;i+=2)

    {

        if(k%i==0) return 0;

    }

    return 1;

}



int main()

{

	int n,m,ans=0;

	scanf("%d",&n);

	for(int i=1;i<=n;i++)

	{

		scanf("%d",&m);

		if(isprime(m)) ans++;

	}

	printf("%d\n",ans);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.760729694079683x):
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

using namespace std;



int main()

{

    int n, i, j, pnum = 0;

    int l;

    scanf("%d", &n);

    for(i = 0; i<n ; i++)

    {

        scanf("%d", &l);

        for(j = 2; j<= sqrt(l)&&(int)l%j != 0; j++);

        if(j == (int)sqrt(l)+1 || l == 2 || l == 3 || l ==5 || l == 7)

            pnum++;

    }

    printf("%d\n", pnum);

    return 0;

}
// Slower C++ solution:
#include<iostream>

#include<vector>

#include <algorithm>



using namespace std;

vector<int> n;



int main(void)

{

    int count,temp,ans=0,rant=0;



    cin>>count;

    for(int i=0;i<count;i++)

    {

        cin>>temp;

        rant=rant>temp?rant:temp;

        n.push_back(temp);

    }



  vector<bool> pri(++rant,0);



   for(int i=2;i*i<rant;i++)

  {

      if(!pri.at(i))

         {



             for(int j=i;j*i<rant;j++)

                {

                   pri[i*j]=true;

                }

         }

  }



    for(int i=0;i<count;i++)

    {

        if(!pri.at(n.at(i)))

            ans++;

    }



  cout<<ans<<endl;

return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.8812708244244565x):
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

using namespace std;



int main()

{

    int n, i, j, pnum = 0;

    int l;

    scanf("%d", &n);

    for(i = 0; i<n ; i++)

    {

        scanf("%d", &l);

        for(j = 2; j<= sqrt(l)&&(int)l%j != 0; j++);

        if(j == (int)sqrt(l)+1 || l == 2 || l == 3 || l ==5 || l == 7)

            pnum++;

    }

    printf("%d\n", pnum);

    return 0;

}
// Slower C++ solution:
#include<stdio.h>

#include<iostream>

#include<math.h>

using namespace std;

int n,tot=0,temp;

bool m[10005];

bool pri(int mt){

	for(int i=2;i<=(int)sqrt(mt);i++){

		if(mt%i==0){

			return 0;

		}

	}

	return 1;

}

int main(void){

	scanf("%d",&n);

	for(int i=0;i<n;i++){

		scanf("%d",&temp);

		if(temp>2){

			if(pri(temp)){

				tot++;

			}

		}

		else if(temp==2){

			tot++;

		}

		else if(temp==1||temp==0){

		}

	}

	printf("%d\n",tot);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.797548101138679x):
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

using namespace std;



int main()

{

    int n, i, j, pnum = 0;

    int l;

    scanf("%d", &n);

    for(i = 0; i<n ; i++)

    {

        scanf("%d", &l);

        for(j = 2; j<= sqrt(l)&&(int)l%j != 0; j++);

        if(j == (int)sqrt(l)+1 || l == 2 || l == 3 || l ==5 || l == 7)

            pnum++;

    }

    printf("%d\n", pnum);

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

int pr[10000001]= {0};

int main()

{

    int i,j,k,s,d,r,n,h,l,x,y,z,g;





    scanf("%d",&g);

    s=0;

   for(h=1; h<=g; h++)

   {

        scanf("%d",&n);





            d=0;

            r=sqrt(n);

            if(n%2==0) d++;

            for(i=3; i<=r; i+=2)

            {

                if(n%i==0) d++;

                if(d>0) break;

            }



            if(n==2) s++;



            else if(d==0) s++;

            







   }

     printf("%d\n",s);





    return 0;



}

// Faster C++ solution for the same problem (measured speedup: 4.797975688015762x):
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

using namespace std;



int main()

{

    int n, i, j, pnum = 0;

    int l;

    scanf("%d", &n);

    for(i = 0; i<n ; i++)

    {

        scanf("%d", &l);

        for(j = 2; j<= sqrt(l)&&(int)l%j != 0; j++);

        if(j == (int)sqrt(l)+1 || l == 2 || l == 3 || l ==5 || l == 7)

            pnum++;

    }

    printf("%d\n", pnum);

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cmath>

using namespace std;

bool f(int n){

    int cnt=0;

    for(int i=2;i<=sqrt(n);i++){

        if(n%i==0)

            cnt++;

    }

    if(cnt==0)

        return true;

    return false;

}

int main(){

    int n,m,cnt=0;

    cin>>n;

    for(int i=0;i<n;i++){

        cin>>m;

        if(f(m))

            cnt++;

        

    }

    cout<<cnt<<endl;

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.822113404367024x):
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

using namespace std;



int main()

{

    int n, i, j, pnum = 0;

    int l;

    scanf("%d", &n);

    for(i = 0; i<n ; i++)

    {

        scanf("%d", &l);

        for(j = 2; j<= sqrt(l)&&(int)l%j != 0; j++);

        if(j == (int)sqrt(l)+1 || l == 2 || l == 3 || l ==5 || l == 7)

            pnum++;

    }

    printf("%d\n", pnum);

    return 0;

}
// Slower C++ solution:
#include <iostream>

using namespace std;

int n,k,t=0;

bool prime(int o)

{

    if(o<2)return false;

    for(int i=2;i*i<=o;i++)if(o%i==0)return false;

    return true;

}

int main()

{

    cin>>n;

    while(n--)

    {

        cin>>k;

        if(prime(k))t++;

    }

    cout<<t<<endl;

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.7860331168839485x):
#include<stdio.h>

#include<string.h>

#include<stdlib.h>

#include<math.h>

using namespace std;



int main()

{

    int n, i, j, pnum = 0;

    int l;

    scanf("%d", &n);

    for(i = 0; i<n ; i++)

    {

        scanf("%d", &l);

        for(j = 2; j<= sqrt(l)&&(int)l%j != 0; j++);

        if(j == (int)sqrt(l)+1 || l == 2 || l == 3 || l ==5 || l == 7)

            pnum++;

    }

    printf("%d\n", pnum);

    return 0;

}