#include <bits/stdc++.h>
int main() {
  int x[10000];
  int n, i, j, flag;
  int cnt = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  for (i = 0; i < n; i++) {
    flag = 1;
    for (j = 2; j < (int)(sqrt(x[i])); j++) {
      if (x[i] % j == 0) {
        flag = 0;
        break;
      }
    }
    if (flag == 1) cnt++;
  }
  printf("%d", cnt);
}
