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