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