#include <bits/stdc++.h>
int main() {
  int i, k, n, a[10000], flag = 0, count = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] == 2 || a[i] == 3) {
      flag = 0;
    } else if (a[i] % 2 == 0) {
      flag = 1;
    } else if (a[i] > 10) {
      if (a[i] - (a[i] / 1) * 10 == 5) flag = 1;
    } else {
      for (k = 2; k <= sqrt(a[i]); k++) {
        if (a[i] % k == 0) {
          flag = 1;
          break;
        }
      }
    }
    if (flag == 0) count++;
    flag = 0;
  }
  printf("%d\n", count);
  return 0;
}
