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