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