#include <bits/stdc++.h>
int main(void) {
  int i, j, k, l, num, count = 0, number[10000], flag = 0;
  scanf("%d", &num);
  for (l = 1; l < num; l++) {
    scanf("%d\n", &number[l]);
    for (i = 3; i <= 10000; i += 2) {
      if (number[l] == 2) flag = 1;
      k = 0;
      for (j = 3; j <= sqrt(i); j += 2) {
        if (i % j == 0) {
          k = 1;
          break;
        }
      }
      if (k == 0 && i == number[l])
        flag = 1;
      else
        break;
    }
    if (flag == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
