#include <stdlib.h>
#include <math.h>
 
// false -> 0
// true -> 1
int isPrime(int n)
{
  if (n <= 1)
    return 0;
  if (n <= 3)
    return 1;
  if (n % 2 == 0)
    return 0;
  int square_root = sqrt(n);
  for (int i = 3; i <= square_root; i += 2)
    if (n % i == 0)
      return 0;
  return 1;
}

int compare_int(const void *a, const void *b)
{
  return *(int*)a - *(int*)b;
}

int main()
{
  int n;
  scanf("%d", &n);
  int a[n], i, j;
  for (i = 0; i < n; i++)
    scanf("%d", &a[i]);
  qsort(a, n, sizeof(int), compare_int);
  int cnt = 0;
  int flg;
  for (i = 0; i < n; i++)
  {
    flg = 0;
    if (a[i] == a[i + 1] || a[i] == a[i - 1])
      flg = 1;
    if (flg == 0)
    {
      if (isPrime(a[i]) == 0)
      {
        for (j = 0; j < i; j++)
        {
          if (a[j] == a[j - 1])
            continue;
          if (a[i] % a[j] == 0)
          {
            flg = 1;
            break;
          }
        }
      }
    }
    if (flg == 0)
      cnt++;
  }
  printf("%d", cnt);
}