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