#include <bits/stdc++.h>
static const int N = 10000;
static const int MIN = 2;
static const int MAX = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10;
int main() {
  int i, j, n, count = 0, prime[N], tmp;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &prime[i]);
  }
  for (i = 0; i < n; i++) {
    tmp = prime[i];
    for (j = 0; j < MAX; j++) {
      prime[i]--;
      if (prime[i] == 1) break;
      if (tmp % prime[i] == 0) break;
    }
    if (prime[i] == 1) count++;
  }
  printf("%d\n", count);
  return 0;
}
