#include<stdio.h>

int main () 
{
  int n = 0, i, ans = 0,temp = 1;
  int a[10000] = 0;
  scanf("%d",&n);

  for (i = 0; i < n; i++) {
    scanf("%d",&a[i]);
  }
  for (i = 0; i < n; i++) {
    temp = 0;
    for (j = 2; j < a[i]; j++) {
      if(a[i] % j == 0) {
        temp = 1;
      }
    if( temp == 1) { 
      break;
    }
    }
    if(temp == 0) { 
      ans = ans + 1;
    } 
  }
  printf("%d\n",ans);

  return 0;
}