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