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