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