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