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