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