using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Math;

namespace CSharpSpiral {
	class Program {
		static void Main(string[] args) {
			var sw = new StreamWriter(Console.OpenStandardOutput()) {
				AutoFlush=
#if DEBUG
			true
#else
			false
#endif
			};
			Console.SetOut(sw);
			new Program().Solve(new ConsoleInput(
#if DEBUG
			new StreamReader("../../../inputData.txt")
#else
			Console.In
#endif
			, ' '));
			Console.Out.Flush();
		}
		public void Solve(ConsoleInput cin) {
			var N = cin.ReadInt;
			var A = cin.ReadIntArray(N);
			var AA = A.Distinct();
			var unique = new HashSet<int>();
			var NotUnique = new HashSet<int>();
			foreach(var a in A) {
				if(unique.Contains(a)) {
					if(!NotUnique.Contains(a))
						NotUnique.Add(a);
				} else {
					unique.Add(a);
				}
			}
			var allow = Enumerable.Repeat(true, 1000001).ToArray();
			allow[0]=false;
			foreach(var a in AA) {
				int t = 2;
				while(a*t<=1000000) {
					allow[a*t]=false;
					t++;
				}
			}
			Console.WriteLine(A.Count(a=>!NotUnique.Contains(a) && allow[a]));
		}
		
	}
	static class ExtendClass {
		public static string Join<T>(this IEnumerable<T> X, string separator = " ") => string.Join(separator, X);
		public static void MergeSort<T>(this T[] A, bool desending) where T : IComparable<T> {
			if(desending)
				MergeSort(A, Comparer<T>.Create((x, y) => y.CompareTo(x)));
			else
				MergeSort(A, Comparer<T>.Create((x, y) => x.CompareTo(y)));
		}
		public static void MergeSort<T>(T[] A, IComparer<T> comparer) where T : IComparable<T> {
			MergeSort1(0, A.Length, A, comparer);
		}
		private static void Merge<T>(int left, int mid, int right, T[] A, IComparer<T> comparer)
			where T : IComparable<T> {
			var nl = mid-left;
			var nr = right-mid;
			var L = new T[nl];
			var R = new T[nr];
			for(int i = 0; i<nl; i++)
				L[i]=A[i+left];
			for(int i = 0; i<nr; i++)
				R[i]=A[i+mid];
			int il = 0, ir = 0;
			for(int k = left; k<right; k++) {
				if(comparer.Compare(L[il], R[ir])<=0) {
					A[k]=L[il++];
					if(il==nl) {
						k++;
						for(; ir<nr;)
							A[k++]=R[ir++];
						break;
					}
				} else {
					A[k]=R[ir++];
					if(ir==nr) {
						k++;
						for(; il<nl;)
							A[k++]=L[il++];
						break;
					}
				}
			}
		}
		private static void MergeSort1<T>(int left, int right, T[] A, IComparer<T> comparer)
		where T : IComparable<T> {
			if(left+1<right) {
				var mid = (left+right)/2;
				MergeSort1(left, mid, A, comparer);
				MergeSort1(mid, right, A, comparer);
				Merge(left, mid, right, A, comparer);
			}
		}
	}
	class ConsoleInput {
		private readonly TextReader _stream;
		private readonly char _separator = ' ';
		private readonly Queue<string> inputStream;
		public ConsoleInput(TextReader stream, char separator = ' ') {
			this._separator=separator;
			this._stream=stream;
			inputStream=new Queue<string>();
		}
		public string Read {
			get {
				if(inputStream.Count!=0) return inputStream.Dequeue();
				string[] tmp = _stream.ReadLine().Split(_separator);
				for(int i = 0; i<tmp.Length; ++i)
					inputStream.Enqueue(tmp[i]);
				return inputStream.Dequeue();
			}
		}
		public string ReadLine { get { return _stream.ReadLine(); } }
		public int ReadInt { get { return int.Parse(Read); } }
		public long ReadLong { get { return long.Parse(Read); } }
		public double ReadDouble { get { return double.Parse(Read); } }
		public string[] ReadStrArray(long N) {
			var ret = new string[N];
			for(long i = 0; i<N; ++i)
				ret[i]=Read;
			return ret;
		}
		public int[] ReadIntArray(long N) { var ret = new int[N]; for(long i = 0; i<N; ++i) ret[i]=ReadInt; return ret; }
		public long[] ReadLongArray(long N) { var ret = new long[N]; for(long i = 0; i<N; ++i) ret[i]=ReadLong; return ret; }
		public double[] ReadDoubleArray(long N) { var ret = new double[N]; for(long i = 0; i<N; ++i) ret[i]=ReadDouble; return ret; }
		public bool isEOF {
			get { return _stream.Peek()==-1; }
		}
	}
	class Node : IComparable<Node> { 
		public int value { get; set; }
		public int id { get; set; }
		public int group{ get; set; }
		public int CompareTo(Node n) => value.CompareTo(n.value);
	}
	class PriorityQueue<T> where T : IComparable<T> {
		protected readonly List<T> body = new List<T>();
		protected Comparer<T> comparer { get; }
		public PriorityQueue(bool maxTop = true) {
			comparer
			=maxTop ? Comparer<T>.Create((T i, T j) => i.CompareTo(j))
			: Comparer<T>.Create((T i, T j) => j.CompareTo(i));
		}
		public PriorityQueue(Comparer<T> mComparer) { comparer=mComparer; }
		//suppose Me>Her if isRootMaximum
		protected int Compare(T Me, T Her) => comparer.Compare(Me, Her);
		protected int Compare(int x, int y) => Compare(body[x], body[y]);
		protected virtual void SwapAt(int x, int y) { T tmp = body[x]; body[x]=body[y]; body[y]=tmp; }
		public virtual void Push(T elem) {
			body.Add(elem);
			//the parent of n-th element is the ((n+1)>>1)-1-th
			UpHeap(lastIndex);
		}
		public void Push(IEnumerable<T> seq) {
			foreach(var item in seq) {
				Push(item);
			}
		}
		protected int UpHeap(int j) {
			while(j>0) {
				int parent = ((j+1)>>1)-1;
				if(Compare(parent, j)<0) {
					SwapAt(parent, j);
				} else break;
				j=parent;
			}
			return j;
		}
		public virtual T Pop() {
			T top = body[0];
			SwapAt(0, lastIndex);
			body.RemoveAt(lastIndex);
			DownHeap(0);
			return top;
		}
		protected int DownHeap(int j) {
			while(j<length) {
				var leftChild = ((j+1)<<1)-1;
				if(leftChild>=length) break;
				var toSwap = leftChild;
				var rightChild = leftChild+1;
				if(rightChild<length&&Compare(leftChild, rightChild)<0)
					toSwap=rightChild;
				if(Compare(j, toSwap)<0) {
					SwapAt(toSwap, j);
				} else break;
				j=toSwap;
			}
			return j;
		}
		public T Top { get { return body[0]; } }
		public int length { get { return body.Count(); } }
		protected int lastIndex { get { return body.Count()-1; } }
		public bool Any() => body.Any();
		public string Emit() { return body.ToArray().Join(","); }
	}
	class ImmutablePriorityQueue<T>: PriorityQueue<T>,IComparable<ImmutablePriorityQueue<T>>
		where T : IComparable<T> {
		public int CompareTo(ImmutablePriorityQueue<T> R) {
			var thisValue = Any() ? Top : defaultValue;
			var thatValue = R.Any() ? R.Top : defaultValue;
			return thisValue.CompareTo(thatValue); 
		}
		public T defaultValue{ get; set; }
		public Dictionary<T, int> map { get; private set; } = new Dictionary<T, int>();
		public ImmutablePriorityQueue(bool maxTop) : base(maxTop) { }
		public ImmutablePriorityQueue(Comparer<T> mComparer) : base(mComparer) { }
		protected override void SwapAt(int x, int y) {
			map[body[x]]=y;
			map[body[y]]=x;
			base.SwapAt(x, y);
		}
		public override void Push(T elem) {
			map.Add(elem, length);
			base.Push(elem);
		}
		public override T Pop() {
			var V = base.Pop();
			map.Remove(V);
			return V;
		}
		public void Remove(T X) {
			var x = map[X];
			SwapAt(x, lastIndex);
			body.RemoveAt(lastIndex);
			map.Remove(X);
			if(x<=lastIndex) {
				var b = DownHeap(x);
				if(b==x&&x!=0)
					UpHeap(x);
			}
		}
		public void Update(T X) {
			var x = map[X];
			var b = DownHeap(x);
			if(b==x) UpHeap(x);
		}
		public bool hasKey(T X) { int c; return map.TryGetValue(X, out c); }
	}
}

Measured memory_bytes: 55540