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