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