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