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