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