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