#include <bits/stdc++.h>
int main() {
  int i, j, n, c[10000], count = 0, yaku;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &c[i]);
  }
  for (i = 0; i < n; i++) {
    yaku = 0;
    if (c[i] == 1)
      continue;
    else if (c[i] == 2)
      count++;
    else if (c[i] % 2 == 0)
      continue;
    else if (c[i] % 2 != 0) {
      for (j = 3; j <= sqrt(i); j += 2) {
        if (c[i] % j == 0) {
          yaku = 1;
          break;
        }
      }
      if (yaku == 0) count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
