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