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