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