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