#include <bits/stdc++.h>
int main() {
  int i = 0, j, n, count = 0, flag, list[10000], PrimeN[10000];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &list[i]);
    if (list[i] != 2 && list[i] != 3)
      if (list[i] % 2 == 0 || list[i] % 3 == 0) continue;
    flag = 1;
    for (j = list[i - 1]; j > 1; j--) {
      if (list[i] % j == 0) flag = 0;
    }
    if (flag == 1) {
      for (j = 0; j < count; j++) {
        if (PrimeN[j] == list[i]) break;
      }
      PrimeN[j] = list[i];
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
