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