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