using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace AC
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadInt();
            var A = ReadArrayInt();
            Array.Sort(A);
            var ind = Enumerable.Repeat(true, N).ToArray();
            var max = A.Max();
            if (N == 1)
            {
                Console.WriteLine(1);
                return;
            }
            else if (A[0] == 1)
            {
                if (A[1] == 1)
                {
                    Console.WriteLine(0);
                    return;
                }
                else
                {
                    Console.WriteLine(1);
                    return;
                }
            }
            else if (A.Contains(2))
            {
                if (A.Count(i => i == 2) != 1)
                {
                    for (int i = 0; i < N; i++)
                    {
                        if (A[i] % 2 == 0) ind[i] = false;
                    }
                }
                else
                {
                    for (int i = 0; i < N; i++)
                    {
                        if (A[i] % 2 == 0 && A[i] != 2) ind[i] = false;
                    }
                }
            }
            if (A[0] == A[1]) ind[0] = false;
            for (int i = 0; i < N; i++)
            {
                var chk = A[i];
                var num = chk;
                if (i != 0) if (!ind[i]) continue;
                if (A[i] == 2) continue;
                if (i > 0 && A[i] == A[i - 1]) continue;
                if (i != N - 1 && A[i] == A[i + 1])
                {
                    for (int j = i; j < N; j++)
                    {
                        if (A[j] == chk) ind[j] = false;
                        else break;
                    }
                }
                while (num <= Math.Min(max, Math.Pow(10, 6)))
                {
                    var idx = LowerBound(A, num);
                    if (num != chk && idx != N)
                    {
                        if (A[idx] % chk == 0)
                        {
                            for (int j = idx; j < N; j++)
                            {
                                if (A[j] == A[idx]) ind[j] = false;
                                else break;
                            }
                        }
                    }
                    num += chk;
                }
            }

            Console.WriteLine(ind.Count(b => b == true));
            Console.ReadLine();
        }

        static int LowerBound(int[] arr, int val)
        {
            if (arr[0] >= val) return 0;
            if (arr[arr.Length - 1] < val) return arr.Length;

            var low = 0;
            var high = arr.Length - 1;

            while (low + 1 < high)
            {
                var mid = (low + high) / 2;
                if (arr[mid] >= val) high = mid;
                else low = mid;
            }

            return high;
        }

        static string Read() { return Console.ReadLine(); }
        static int ReadInt() { return int.Parse(Read()); }
        static long ReadLong() { return long.Parse(Read()); }
        static string[] ReadArrayString() { return Read().Split(' '); }
        static int[] ReadArrayInt() { return Read().Split(' ').Select(s => int.Parse(s)).ToArray(); }
        static long[] ReadArrayLong() { return Read().Split(' ').Select(s => long.Parse(s)).ToArray(); }
    }
}

Measured memory_bytes: 44484