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