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