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