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