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