#include <bits/stdc++.h>
int main() {
  int i, j, sum, flag = 1, sei, count = 0;
  scanf("%d", &sum);
  j = sum;
  while (j > 0) {
    scanf("%d", &sei);
    if (flag == 0) flag = 1;
    for (i = 2; i < sei; i++) {
      if (sei % i == 0) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) count++;
    j--;
  }
  printf("%d\n", count);
  return 0;
}
