using System;
using System.Linq;
using System.Collections.Generic;

namespace AtCoder.Contests.ABC170
{
    /// <summary>
    /// 
    /// </summary>
    static class D
    {
        static void Main(string[] args)
        {
            var n = NextInt();
            var aas = ReadIntArray();

            //var set = new HashSet<int>(aas);

            var cd = new CountDic<int>();
            for (int i = 0; i < n; i++)
            {
                cd.CountUp(aas[i]);
            }

            if (cd[1] > 0)
            {
                if (cd[1] == 1)
                {
                    Console.WriteLine(1);
                }
                else
                {
                    Console.WriteLine(0);
                }
                return;
            }

            var count = 0;
            for (int i = 0; i < n; i++)
            {
                var a = aas[i];
                var next = false;
                if (cd[a] > 1) continue;
                for (int j = 2; j <= Math.Sqrt(a); j++)
                {
                    if (a % j == 0)
                    {
                        if (cd[j] > 0 || cd[a / j] > 0)
                        {
                            next = true;
                            break;
                        }
                    }
                }
                if (next)
                {
                    continue;
                }
                count++;
            }

            Console.WriteLine(count);
        }

        #region Console
        static int _index = 0;
        static string[] _buffer;

        static string Next()
        {
            if (_buffer == null || _index >= _buffer.Length)
            {
                _buffer = Console.ReadLine().Split();
                _index = 0;
            }

            return _buffer[_index++];
        }
        static int NextInt()
        {
            return int.Parse(Next());
        }
        static long NextLong()
        {
            return long.Parse(Next());
        }
        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }
        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }
        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }
        static int[] ReadIntArray(int n)
        {
            var a = new int[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = ReadInt();
            }
            return a;
        }
        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }
        static long[] ReadLongArray(int n)
        {
            var a = new long[n];
            for (int i = 0; i < n; i++)
            {
                a[i] = ReadLong();
            }
            return a;
        }
        static List<T> ReadObjects<T>(int n, Func<int[], T> creator)
        {
            var l = new List<T>(n);

            for (int i = 0; i < n; i++)
            {
                var a = ReadIntArray();
                l.Add(creator(a));
            }

            return l;
        }

        static int[,] ReadMatrix(int n, int m)
        {
            var r = new int[n, m];
            for (int i = 0; i < n; i++)
            {
                var a = ReadIntArray();
                for (int j = 0; j < m; j++)
                {
                    r[i, j] = a[j];
                }
            }
            return r;
        }
        #endregion

        class CountDic<T> : IDictionary<T, int>
        {
            private Dictionary<T, int> _dic = new Dictionary<T, int>();
            public int this[T key]
            {
                get
                {
                    return Get(key);
                }

                set
                {
                    _dic[key] = value;
                }
            }

            public ICollection<T> Keys
            {
                get
                {
                    return _dic.Keys;
                }
            }

            public ICollection<int> Values
            {
                get
                {
                    return _dic.Values;
                }
            }

            public int Count
            {
                get
                {
                    return _dic.Count;
                }
            }

            public bool IsReadOnly
            {
                get
                {
                    return false;
                }
            }

            public void Add(T key, int value)
            {
                _dic.Add(key, value);
            }

            public void Add(KeyValuePair<T, int> item)
            {
                throw new NotImplementedException();
            }

            public void Clear()
            {
                _dic = new Dictionary<T, int>();
            }

            public bool Contains(KeyValuePair<T, int> item)
            {
                return _dic.Contains(item);
            }

            public bool ContainsKey(T key)
            {
                return _dic.ContainsKey(key);
            }

            public void CopyTo(KeyValuePair<T, int>[] array, int arrayIndex)
            {
                throw new NotImplementedException();
            }

            public IEnumerator<KeyValuePair<T, int>> GetEnumerator()
            {
                return _dic.GetEnumerator();
            }

            public bool Remove(T key)
            {
                return _dic.Remove(key);
            }

            public bool Remove(KeyValuePair<T, int> item)
            {
                return _dic.Remove(item.Key);
            }

            public bool TryGetValue(T key, out int value)
            {
                value = Get(key);
                return true;
            }

            System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
            {
                return _dic.GetEnumerator();
            }

            private int Get(T key)
            {
                int c;
                if (_dic.TryGetValue(key, out c))
                {
                    return c;
                }
                else
                {
                    return 0;
                }
            }
            public int CountUp(T key)
            {
                var c = Get(key) + 1;
                _dic[key] = c;
                return c;
            }
        }
    }
}


Measured memory_bytes: 53476