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