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