#include <bits/stdc++.h>
void judge(int x) {
  static int sum = 0;
  int flag = 0, i;
  if (x == 0) {
    printf("%d\n", sum);
    exit(0);
  }
  for (i = 2; i < x; ++i) {
    if (x % i == 0) {
      flag = 1;
      break;
    }
  }
  if (flag == 0) sum += 1;
}
int main() {
  int a, n, i;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    judge(a);
  }
  judge(0);
  return 0;
}
