#include <stdio.h>
#include <math.h>

void judge(int x)
{
	int j;
	if(x < 2)
      return 0;
	else if(x == 2)
	  return 1;
	if(x%2 == 0)
	  return 0;
	for(j = 3; j*j < x; j++){
		if(x%j = 0)
		  return 0;
	}
	return 1;
}

int main()
{
  int n, i, count;
  int a[100];

  scanf("%d", &n);

  for(i = 0; i < n; i++)
    scanf("%d",&a[i]);
    
  count = 0;
    
  for(i = 0; i < n; i++){
  	if(judge(a[i]))
  	  count++;
  }
  	  
  printf("%d\n", count);

  return 0;
}