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