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