#include <bits/stdc++.h>
int main() {
  int i, j;
  int sum;
  int n;
  int f = 0;
  int count = 0;
  scanf("%d", &sum);
  for (i = 0; i < sum; i++) {
    f = 0;
    scanf("%d", &n);
    for (j = 2; j < n; j++) {
      if (n % j == 0) {
        f = 1;
        break;
      }
    }
    if (f == 0) count++;
  }
  printf("%d\n", count);
  return 0;
}
