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