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