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