#include <stdio.h>

int sosu(int *)

int main(){
  
  int i,n,a[10000],c;
  
  scanf("%d",&n);
  for(i=0;i<n;i++) scanf("%d",&a[i]);
  
  for(i=0;i<n;i++) {
    c = sosu(a[i]);
    if(c == 1) b++;
  }
  
  printf("%d\n",b);
  
  return 0;
}

int sosu(int *n) {
  int i;

  if(n<2)
    return 0;
  else if(n == 2)
    return 1;

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

  for(i=3;i<=n/i;i+=2)
    if(n%i == 0)
      return 0;
  return 1;

}