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