#include <bits/stdc++.h>
int main() {
  int a, i, n, x, judge, result = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    judge = 0;
    for (x = a - 1; x > 1; x--) {
      if (a % x == 0) {
        judge++;
        break;
      }
      if (x * x > a) break;
    }
    if (judge == 0) result++;
  }
  printf("%d\n", result);
  return 0;
}
