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