#include <bits/stdc++.h>
int main() {
  int n, i, j, a;
  int flag, c = 0;
  int s;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &a);
    if (a == 2) {
      c++;
    } else if (a < 2 || a % 2 == 0) {
      continue;
    } else {
      flag = 0;
      s = sqrt(a);
      for (j = 3; j < s; j += 2) {
        if (a % j == 0) {
          flag = 1;
          break;
        }
      }
      if (flag == 0) c++;
    }
  }
  printf("%d\n", c);
  return 0;
}
