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