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