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