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