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