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