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