#include<bits/stdc++.h>
using namespace std;
int main(void)
{
	int n,a,ans=0;
	cin>>n;
	int g=n;
	while(n--)
	{
		cin>>a;
		for(int i=2;i<=sqrt(a);i+=(i==2?1:2))
		{
			if(a%i==0)
			{
				ans++;break;
			}
		}
	}
	cout<<g-ans<<endl;
	return 0;
 } 
