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