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