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