#include<stdio.h>
#define N 10000


main(){

  int n,i,k,prime=0,count=0;
  int m[N];

  scanf("%d",&n);

  for(i=0;i<n;i++)scanf("%d",&m[i]);

  for(i=0;i<n;i++){
    for(k=1;k<m[i]+1;k++)if(m[i]%k == 0)count++;
    if(count == 2)prime++;
    count=0;
  }
		       
  printf("%d\n",prime);

retuen0;
}