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