#include <bits/stdc++.h>
int main() {
  int i, j, n, c = 0;
  scanf("%d", &n);
  int arr[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
    for (j = 2; j < arr[i]; j++)
      if (arr[i] % j == 0) break;
    if (arr[i] == j) c++;
  }
  printf("%d\n", c);
  return 0;
}
