#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int judge, count, flag, j;
  double x;
  count = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &judge);
    if (judge == 2) {
      count++;
    } else if (judge > 2 && judge % 2 == 0) {
    } else if (judge > 2) {
      x = sqrt(judge);
      if (x < 3) {
        flag = 1;
      }
      for (j = 3; j < x; j = j + 2) {
        if (judge % j == 0) {
          flag = 0;
        } else {
          flag = 1;
        }
        if (flag == 0) {
          break;
        }
      }
      if (flag == 1) {
        count++;
      } else {
      }
    }
  }
  printf("%d\n", count);
  return 0;
}
