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