#include <stdio.h>
int prime(int x){
int a; 
if(x < 2)
 return 0; 
if(x == 2)
 return 1;
 if(x % 2 == 0)
 return 0;
 for(i = 3;a * a <= x;a += 2)
 if(x % a == 0)
 return 0;
 return 1; }

 int main(void){
 int a,n, c = 0, b;
 scanf("%d", &n);
 for(i = 0;a < n;a++){
 scanf("%d", &b); c += prime(b);
 }
 printf("%d\n", c);
 return 0;
} 
