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