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