#include <bits/stdc++.h>
int main(int argc, char* argv[]) {
  int c = 0;
  scanf("%d", &c);
  int count = 0;
  for (int i = 0; i < c; i++) {
    int num = 0;
    scanf("%d", &num);
    if (num == 1 || num == 2) {
      count++;
    } else if (num % 2 != 0) {
      int f = 1;
      for (int j = 3; j < num; j += 2) {
        if (num % j == 0) {
          f = 0;
          break;
        }
      }
      if (f) {
        count++;
      }
    }
  }
  printf("%d\r\n", count);
  return 0;
}
