You are given a sequence of integers $a_1, a_2, \dots, a_n$. You need to paint elements in colors, so that:   If we consider any color, all elements of this color must be divisible by the minimal element of this color.  The number of used colors must be minimized. 

For example, it's fine to paint elements $[40, 10, 60]$ in a single color, because they are all divisible by $10$. You can use any color an arbitrary amount of times (in particular, it is allowed to use a color only once). The elements painted in one color do not need to be consecutive.

For example, if $a=[6, 2, 3, 4, 12]$ then two colors are required: let's paint $6$, $3$ and $12$ in the first color ($6$, $3$ and $12$ are divisible by $3$) and paint $2$ and $4$ in the second color ($2$ and $4$ are divisible by $2$). For example, if $a=[10, 7, 15]$ then $3$ colors are required (we can simply paint each element in an unique color).


-----Input-----

The first line contains an integer $n$ ($1 \le n \le 100$), where $n$ is the length of the given sequence.

The second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 100$). These numbers can contain duplicates.


-----Output-----

Print the minimal number of colors to paint all the given numbers in a valid way.


-----Examples-----
Input
6
10 2 3 5 4 2

Output
3

Input
4
100 100 100 100

Output
1

Input
8
7 6 5 4 3 2 2 3

Output
4



-----Note-----

In the first example, one possible way to paint the elements in $3$ colors is:

  paint in the first color the elements: $a_1=10$ and $a_4=5$,  paint in the second color the element $a_3=3$,  paint in the third color the elements: $a_2=2$, $a_5=4$ and $a_6=2$. 

In the second example, you can use one color to paint all the elements.

In the third example, one possible way to paint the elements in $4$ colors is:

  paint in the first color the elements: $a_4=4$, $a_6=2$ and $a_7=2$,  paint in the second color the elements: $a_2=6$, $a_5=3$ and $a_8=3$,  paint in the third color the element $a_3=5$,  paint in the fourth color the element $a_1=7$.

Difficulty: EASY
Tags: Mathematics

Implementation

Greedy algorithms
Skill types: Greedy algorithms
Expected Time Complexity: O(N^2)

Starter code:

Solutions:
n = int(input())
arr = [int(x) for x in input().split()]
arr.sort()
count = 0
while len(arr) != 0:
	ele1 = arr[0]
	brr = arr[1:]
	temp = 0
	for i in range(len(brr)):
		if brr[i] % ele1 == 0:
			temp = 1
			arr.remove(brr[i])
	count += 1
	arr.remove(ele1)
print(count)


n = int(input())
nums = list(map(int, input().split()))
nums.sort()
check = [0 for _ in range(101)]
ans = 0
for i in nums:
	for j in nums:
		if i % j == 0 and check[j] == 0:
			check[j] = 1
			ans += 1
			break
		if i % j == 0 and check[j] != 0:
			break
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
while len(a):
	x = a[0]
	a.pop(0)
	ans += 1
	i = 0
	while i < len(a):
		if a[i] % x == 0:
			a.pop(i)
			i -= 1
		i += 1
print(ans)


def main():
	import sys
	input = sys.stdin.readline
	n = int(input())
	arr = list(map(int, input().split()))
	color = [0] * n
	arr.sort()
	ans = 0
	for i in range(n):
		if color[i]:
			continue
		ans += 1
		for j in range(i, n):
			if arr[j] % arr[i] == 0:
				color[j] = ans
	print(ans)
	return 0
main()


n = int(input())
l = list(map(int, input().strip().split()))
l.sort()
used = [False for i in range(n)]
ans = 0
for i in range(n):
	if used[i] == False:
		ans += 1
		used[i] = True
		for j in range(i, n):
			if l[j] % l[i] == 0:
				used[j] = True
print(ans)


n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for t in range(n):
	if l[t] != 0:
		ans += 1
		za = l[t]
		for i in range(n):
			if l[i] != 0:
				if l[i] % za == 0:
					l[i] = 0
print(ans)


import sys
import collections
import functools
n = int(input().strip())
m = sorted(map(int, input().strip().split()))
sets = set(m)
nums = [False] * 101
ans = 0
for (i, v) in enumerate(m):
	if nums[v]:
		continue
	ans += 1
	for j in range(v, 101, v):
		nums[j] = True
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0] * n
c = 0
for i in range(n):
	if b[i] != 1:
		for j in range(n):
			if a[j] % a[i] == 0 and b[j] != 1:
				b[j] = 1
		c += 1
		if 0 not in b:
			break
print(c)


n = int(input())
res = 0
visited = [0] * n
num = list(map(int, input().split()))
num.sort()
for i in range(n):
	if visited[i] == 1:
		continue
	for j in range(i + 1, n):
		if visited[j] == 1:
			continue
		if num[i] % num[j] == 0 or num[j] % num[i] == 0:
			visited[i] = 1
			visited[j] = 1
	res += 1
print(res)


n = int(input())
a = sorted(list(map(int, input().split())))
visited = [False] * n
ans = 0
for i in range(n):
	if not visited[i]:
		ans += 1
		for j in range(i, n):
			if a[j] % a[i] == 0:
				visited[j] = True
print(ans)


t = int(input())
a = set(map(int, input().split()))
q = 0
while len(a) > 0:
	c = min(list(a))
	for i in list(a):
		if i % c == 0:
			a.remove(i)
	q += 1
print(q)


n = int(input())
ai = list(map(int, input().split()))
ai = set(ai)
print(sum((all((x % y for y in ai - {x})) for x in ai)))


n = int(input())
a = sorted(list(map(int, input().split())))
m = 0
x = [0] * n
for i in range(n):
	if x[i] == 0:
		for j in range(i + 1, n):
			if a[j] % a[i] == 0:
				x[j] = 1
		m += 1
print(m)


n = int(input())
n = 0
l = sorted([int(i) for i in input().split()])
l1 = []
for i in l:
	c = 0
	if i in l1:
		c = 1
	else:
		for j in l1:
			if i % j == 0:
				c = 1
	if c == 0:
		l1.append(i)
		n += 1
print(n)


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
a.sort()
d = defaultdict(int)
for i in a:
	flag = True
	for j in d.keys():
		if i % j == 0:
			flag = False
			d[j] += 1
			break
	if flag:
		d[i] += 1
print(len(d))


n = int(input())
x = list(map(int, input().split()))
c = 0
while len(x) > 0:
	m = min(x)
	x = [a for a in x if a % m != 0]
	c += 1
print(c)


n = int(input())
a = list(map(int, input().split()))
a.sort()
i = 0
while i < len(a):
	j = i + 1
	while j < len(a):
		if a[j] % a[i] == 0:
			a.pop(j)
		else:
			j += 1
	i += 1
print(len(a))


count = int(input())
numbers = [int(i) for i in input().split(' ')]
numbersSorted = sorted(numbers)
colorsCount = 0
numbersToDelete = []
while len(numbersSorted) > 0:
	colorsCount += 1
	for i in range(len(numbersSorted)):
		if numbersSorted[i] % numbersSorted[0] == 0:
			numbersToDelete.append(numbersSorted[i])
	for j in range(len(numbersToDelete)):
		if numbersToDelete[j] in numbersToDelete:
			numbersSorted.remove(numbersToDelete[j])
	numbersToDelete = []
print(colorsCount)


import sys
counter = 0
numels = int(sys.stdin.readline())
numarray = sys.stdin.readline().split(' ')
for curr in range(numels):
	numarray[curr] = int(numarray[curr])
numarray = list(set(numarray))
max_coverage = 0
best_divisor = 0
loners = []
for curr in numarray:
	curr_coverage = 0
	curr_loners = []
	for p in range(len(numarray)):
		if numarray[p] % curr == 0:
			curr_coverage = curr_coverage + 1
		else:
			curr_loners.append(numarray[p])
	if curr_coverage > max_coverage:
		max_coverage = curr_coverage
		best_divisor = curr
		loners = curr_loners
if max_coverage == len(numarray):
	print(1)
elif max_coverage == len(numarray) - 1:
	print(2)
else:
	cumsum = 0
	sorted_loners = sorted(loners, reverse=False)
	covered = 0
	iterations = 1
	covered_nums = []
	for t in range(len(sorted_loners)):
		if sorted_loners[t] in covered_nums:
			continue
		iterations = iterations + 1
		covered = covered + 1
		covered_nums.append(sorted_loners[t])
		for p in range(t + 1, len(sorted_loners)):
			if sorted_loners[p] % sorted_loners[t] == 0:
				if sorted_loners[p] in covered_nums:
					continue
				else:
					covered = covered + 1
					covered_nums.append(sorted_loners[p])
		if covered + max_coverage == len(numarray):
			print(iterations)


n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
while len(a) > 0:
	k = a.pop(0)
	a = [i for i in a if i % k != 0]
	ans += 1
print(ans)


n = int(input())
l = list(map(int, input().split()))
l = list(set(l))
l.sort()
count = 0
for i in range(len(l)):
	if l[i] != 'False':
		for j in range(i + 1, len(l)):
			if l[j] != 'False':
				if l[j] % l[i] == 0:
					l[j] = 'False'
		count += 1
print(count)


n = int(input())
list1 = list(map(int, input().split()))
count = 0
list1.sort()
flag = [0] * len(list1)
for i in range(len(list1)):
	if flag[i] == 0:
		flag[i] = 1
		for j in range(1, len(list1)):
			if list1[j] % list1[i] == 0:
				flag[j] = 1
		count += 1
print(count)


n = int(input())
a = list(map(int, input().split()))
a.sort()
s = [[a[0]]]
for e in a[1:]:
	d = False
	for se in s:
		if not e % se[0]:
			se.append(e)
			d = True
			break
	if not d:
		s.append([e])
print(len(s))


def crivo(tam, x):
	memo = [0] * 112
	cont = 0
	for i in range(0, tam):
		if memo[x[i]] == 1:
			continue
		memo[x[i]] = 1
		cont += 1
		for j in range(i + 1, tam):
			if x[j] % x[i] == 0:
				memo[x[j]] = 1
	return cont
N = int(input())
lis = list(map(int, input().split()))
aux = sorted(set(lis))
print(crivo(len(aux), aux))


n = int(input())
c = list(map(int, input().split()))
count = 0
temp = None
i = 0
c.sort()
while c:
	i = i % len(c)
	if i == 0:
		if temp:
			c.pop(0)
			count += 1
			if len(c) == 0:
				break
		temp = c[i]
	elif c[i] % temp == 0:
		c.pop(i)
		continue
	i += 1
print(count)


n = int(input())
a = list(map(int, input().split()))
a.sort()
nr = 1
for i in range(1, len(a)):
	ok = 0
	for j in range(i):
		if a[i] % a[j] == 0:
			ok = 1
	if not ok:
		nr += 1
print(nr)


n = int(input())
a = list(map(int, input().strip().split()))
a.sort()
c = 0
for i in range(len(a)):
	for j in range(i, len(a)):
		if a[j] % a[i] == 0:
			a[j] = a[i]
s = set(a)
print(len(s))


n = int(input())
a = sorted(list(map(int, input().split())))
numColors = 0
c = False
b = n
for i in range(len(a)):
	for j in range(i, len(a)):
		if a[j] % a[i] == 0 and a[j] != -1 and (a[i] != -1):
			if j != i:
				a[j] = -1
			b -= 1
			c = True
	if b != 0 and c:
		numColors += 1
	c = False
print(numColors + 1)


n = int(input())
L = list(map(int, input().split()))
color = [0] * len(L)

def divisibleBy(l, nums):
	for i in nums:
		if l % i == 0:
			return True
	else:
		return False
L.sort()
nums = []
for i in range(n):
	if not divisibleBy(L[i], nums):
		nums.append(L[i])
print(len(nums))


n = int(input())
a = list(map(int, input().split()))
a.sort()
s = []
colours = 0
flag = 0
for i in a:
	for j in s:
		if i % j == 0:
			flag = 1
	if flag == 0:
		s.append(i)
		colours += 1
	else:
		flag = 0
print(colours)


def selection_sort(l):
	for i in range(len(l)):
		minimum_value = l[i]
		index_minimum = i
		for j in range(i, len(l)):
			if l[j] < minimum_value:
				minimum_value = l[j]
				index_minimum = j
		(l[i], l[index_minimum]) = (l[index_minimum], l[i])
	return l

def bubble_sort(l):
	for i in range(len(l)):
		for j in range(len(l) - i - 1):
			if l[j] > l[j + 1]:
				(l[j], l[j + 1]) = (l[j + 1], l[j])
	return l

def insertion_sort(l):
	for i in range(len(l)):
		for j in range(i):
			k = i - j
			if l[k - 1] > l[k]:
				(l[k], l[k - 1]) = (l[k - 1], l[k])
			else:
				break
	return l

def merge_sort(l):

	def merge(l1, l2):
		(i, j) = (0, 0)
		output_list = []
		while i < len(l1) and j < len(l2):
			if l1[i] < l2[j]:
				output_list.append(l1[i])
				i += 1
			else:
				output_list.append(l2[j])
				j += 1
		if i == len(l1):
			output_list += l2[j:]
		else:
			output_list += l1[i:]
		return output_list

	def sort(l):
		if len(l) < 2:
			return l
		else:
			mid = len(l) // 2
			left = sort(l[:mid])
			right = sort(l[mid:])
			return merge(left, right)
	return sort(l)

def quick_sort(l):

	def partition(l, start, end):
		pivot_index = end
		i = start
		for j in range(start, end):
			if l[pivot_index] > l[j]:
				(l[j], l[i]) = (l[i], l[j])
				i += 1
		(l[i], l[pivot_index]) = (l[pivot_index], l[i])
		return i

	def recursive_part(l, start, end):
		if len(l) < 2:
			return l
		elif start < end:
			p = partition(l, start, end)
			recursive_part(l, start, p - 1)
			recursive_part(l, p + 1, end)
	return recursive_part(l, 0, len(l) - 1)

def main_function():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	a = merge_sort(a)
	d = {}
	not_found = True
	for i in a:
		not_found = True
		for j in d:
			if not i % j:
				d[j] += 1
				not_found = False
				break
		if not_found:
			d[i] = 1
	return len(d)
print(main_function())


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
d = {}
for x in a:
	if x not in d.keys():
		d[x] = 1
c = 0
for i in range(len(a)):
	if d[a[i]] != 2:
		c = c + 1
		for j in range(i, len(a)):
			if a[j] % a[i] == 0:
				d[a[j]] = 2
print(c)


def PaintTheNumbers(n, seq):
	color = set()
	painted = [0] * (n + 1)
	i = 0
	while i < n:
		painted[i] = seq[i]
		j = 0
		while j < n:
			if seq[i] % seq[j] == 0:
				if seq[j] < painted[i]:
					painted[i] = seq[j]
			j += 1
		if painted[i] == seq[i]:
			color.add(painted[i])
		i += 1
	print(len(color))
n = int(input())
a = [int(x) for x in input().split()]
PaintTheNumbers(n, a)


import sys
from math import gcd
input = sys.stdin.readline
out = sys.stdout

def main():
	n = int(input())
	a = list(map(int, input().split()))
	a.sort()
	b = [False] * n
	ans = 1
	for j in range(n):
		if b[j] == True:
			continue
		for i in range(n):
			if a[i] % a[j] == 0:
				b[i] = True
		if False not in b:
			break
		else:
			ans += 1
	print(ans)
main()


n = int(input())
l = list(map(int, input().split()))
l.sort()
w = [False] * n
r = 0
for i in range(n):
	if w[i] == False:
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				w[j] = True
		r += 1
print(r)


N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
for (i, a) in enumerate(A):
	for b in A[:i]:
		if a % b == 0:
			break
	else:
		ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
d = []
while len(a) != 0:
	c = []
	c.append(a[0])
	k = 0
	for i in range(1, len(a)):
		if a[i] % a[0] == 0:
			c.append(a[i])
			a[i] = 0
			k += 1
	del a[0]
	for i in range(k):
		del a[a.index(0)]
	d.append(c)
	c = []
print(len(d))


n = int(input())
s = list(set(map(int, input().split())))
count = 0
while len(s) > 0:
	s = list(filter(lambda x: x % min(s) != 0, s))
	count += 1
print(count)


n = int(input())
num = [0 for _ in range(101)]
a = list(map(int, input().split()))
for v in a:
	num[v] += 1
c = 0
for i in range(1, 101):
	if num[i] > 0:
		c += 1
		add = i
		cur = i
		while cur <= 100:
			num[cur] = 0
			cur += add
print(c)


n = int(input())
l = [int(i) for i in input().split()]
l.sort()
s = set([l[0]])
res = 1
for i in l:
	f = 1
	for j in s:
		if i % j == 0:
			f = 0
			break
	if f:
		s.add(i)
		res += 1
print(res)


import sys
from sys import stdin, stdout
from collections import defaultdict
from collections import deque
import math
import copy
N = int(input())
arr = [int(x) for x in stdin.readline().split()]
arr.sort()
res = 0
flag = [0] * N
for i in range(N):
	if flag[i] == 0:
		for j in range(i, N):
			if arr[j] % arr[i] == 0:
				flag[j] = 1
		res += 1
	if sum(flag) == N:
		break
print(res)


n = int(input())
a = [0] * 101
q = 0
b = set()
for x in input().split():
	a[int(x)] = 1
for i in range(101):
	if a[i]:
		try:
			min([j for j in b if i % j == 0])
		except ValueError:
			b.add(i)
			q += 1
print(q)


n = int(input())
ls = list(map(int, input().split()))
cnt = 0
ls = sorted(ls)
while True:
	p = ls[0]
	ls2 = []
	for i in ls:
		if i % p == 0:
			continue
		else:
			ls2.append(i)
	cnt += 1
	ls = ls2
	if ls == []:
		break
print(cnt)


n = int(input())
arr = list(map(int, input().split()))
colors = 0
while arr:
	smallest = arr[0]
	for e in arr:
		if e < smallest:
			smallest = e
	new = []
	for e in arr:
		if e % smallest == 0:
			new.append(e)
	if new:
		colors += 1
	for m in new:
		arr.remove(m)
print(colors)


n = int(input())
x = map(int, input().split())
s = []
for i in x:
	if i not in s:
		s.append(i)
s.sort()
l = s
n = 0
if s[0] == 1:
	print(1)
else:
	for i in l:
		s.remove(i)
		for j in s:
			if j % i == 0:
				l.remove(j)
		s.append(i)
		l.insert(n, i)
		n += 1
	h = []
	for i in l:
		if i not in h:
			h.append(i)
	print(len(h))


n = int(input())
numbers = [int(integer) for integer in input().split()]
numbers.sort()
number_of_colors = 0
for idx in range(n):
	if numbers[idx] != 0:
		number_of_colors += 1
		for j in range(idx + 1, n):
			if numbers[j] != 0 and numbers[j] % numbers[idx] == 0:
				numbers[j] = 0
print(number_of_colors)


n = int(input())
nums = list(map(int, input().split()))
nums.sort(reverse=True)
colors = 0
while True:
	if not nums:
		break
	el = nums.pop()
	nums2 = []
	colors += 1
	for i in range(len(nums)):
		if nums[i] % el != 0:
			nums2.append(nums[i])
	nums = nums2
print(colors)


n = int(input())
a = list(map(int, input().split(' ')))
colors = []
while len(a):
	temp = []
	for i in range(n):
		try:
			if a[i] % min(a) == 0:
				temp.append(a[i])
		except IndexError:
			continue
	colors.append(temp)
	a = list(set(a) - set(temp))
print(len(colors))


n = map(int, input().split())
l = list(map(int, input().split()))
color = 0
while len(l):
	a = []
	color += 1
	m = min(l)
	for i in l:
		if i % m != 0:
			a.append(i)
	l = a
print(color)


import sys
input = sys.stdin.readline

def getInt():
	return int(input())

def getVars():
	return map(int, input().split())

def getList():
	return list(map(int, input().split()))

def getStr():
	return input().strip()

def addDictList(d, key, val):
	if key not in d:
		d[key] = []
	d[key].append(val)

def addDictInt(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] = val

def addDictCount(d, key):
	if key not in d:
		d[key] = 0
	d[key] += 1

def addDictSum(d, key, val):
	if key not in d:
		d[key] = 0
	d[key] += val
n = getInt()
a = getList()
a.sort()
if min(a) == 1:
	print(1)
else:
	d = []
	for x in a:
		good = False
		for d1 in d:
			if x % d1 == 0:
				good = True
				break
		if not good:
			d.append(x)
	print(len(d))


n = int(input())
l = list(map(int, input().split()))
l.sort()
count = 1
for i in range(len(l)):
	if i != 0:
		for j in range(i):
			if l[i] % l[j] == 0:
				break
		else:
			count += 1
print(count)


n = int(input())
l = set(map(int, input().split()))
l = list(l)
l.sort()
res = set()
cnt = 0
for i in l:
	for j in res:
		if i % j == 0:
			break
	else:
		cnt += 1
		res.add(i)
print(cnt)


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = LI()
	check = [False] * n
	l.sort()
	ans = 0
	for i in range(n):
		if check[i]:
			continue
		ans += 1
		check[i] = True
		for j in range(n):
			if l[j] % l[i] == 0:
				check[j] = True
	return ans
print(main())


def lot(A):
	if len(A) == 0:
		return 1
	elif len(A) == 1:
		B = list()
		return lot(B) + 1
	else:
		A.sort()
		B = list()
		k = A[0]
		for i in range(1, len(A)):
			if A[i] % k != 0:
				B.append(A[i])
		return lot(B) + 1
n = int(input())
A = list(map(int, input().split()))
print(lot(A) - 1)


n = input()
l = sorted([int(x) for x in input().split(' ')])
d = []
d.append(l[0])
for i in l[1:]:
	found = False
	for j in d:
		if j * (i // j) == i:
			found = True
			break
	if not found:
		d.append(i)
print(len(d))


n = int(input())
l = list(map(int, input().split()))
c = 0
while len(l) > 0:
	l.sort()
	xl = l.copy()
	x = l[0]
	f = 0
	for i in range(len(l)):
		if l[i] % x == 0:
			xl.pop(i - f)
			f += 1
	c += 1
	l = xl.copy()
print(c)


n = int(input())
l = list(map(int, input().split()))
l.sort()
k = [0] * n
c = 0
for i in range(n):
	if k[i] == 0:
		k[i] = 1
		c = c + 1
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				k[j] = 1
print(c)


(n, l) = (int(input()), sorted(list(set(map(int, input().split())))))
cal = len(l)
for _ in range(len(l) - 1):
	for i in range(_ + 1, len(l)):
		if l[i] % l[_] == 0 and l[_] != 107:
			l[i] = 107
			cal = cal - 1
print(cal)


from sys import stdin
input = lambda : stdin.readline()
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(map(int, input().split()))
ln = ii()
a = li()
f = []
c = 0
l = sorted(list(set(a)))
n = len(l)
f = [-1] * 101
for i in range(n):
	if f[l[i]] == -1:
		f[l[i]] = 0
	for j in range(i + 1, n):
		if l[i] % l[j] == 0 or l[j] % l[i] == 0:
			f[l[j]] = 1
print(f.count(0))


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
color = 0
while a:
	b = []
	for i in a[1:]:
		if i % a[0] != 0:
			b.append(i)
	color += 1
	a = b
print(color)


input()
data = {int(i): 1 for i in input().split(' ')}
newData = sorted(list(data.keys()))
colors = 0
for (index, item) in enumerate(newData):
	for j in range(0, index):
		if item % newData[j] == 0:
			break
	else:
		colors += 1
print(colors)


import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub
sys.setrecursionlimit(100000)
input = sys.stdin.readline

def read_int():
	return int(input())

def read_int_n():
	return list(map(int, input().split()))

def read_float():
	return float(input())

def read_float_n():
	return list(map(float, input().split()))

def read_str():
	return input().strip()

def read_str_n():
	return list(map(str, input().split()))

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

@mt
def slv(N, A):
	D = defaultdict(list)
	for a in A:
		D[a] = set()
		D[a].add(a)
	for (i, j) in permutations(range(N), r=2):
		a = A[i]
		b = A[j]
		if a % b == 0:
			D[a].add(b)
	A.sort(key=lambda x: len(D[x]))

	@lru_cache(maxsize=None)
	def dfs(i, c):
		if i == len(A):
			return len(c)
		ans = sys.maxsize
		c = set(c)
		for d in D[A[i]]:
			if d in c:
				t = dfs(i + 1, tuple(c))
				ans = min(ans, t)
				break
		else:
			for d in D[A[i]]:
				if d not in c:
					t = dfs(i + 1, tuple(c | set([d])))
					ans = min(ans, t)
		return ans
	return dfs(0, tuple())

def main():
	N = read_int()
	A = read_int_n()
	print(slv(N, A))
main()


N = int(input())
numberList = list(map(int, input().strip().split(' ')))
isDivided = [False for i in range(len(numberList))]
for i in range(N):
	if isDivided[i] == False:
		for j in range(N):
			if i == j:
				continue
			if isDivided[j] == False and numberList[j] % numberList[i] == 0:
				isDivided[j] = True
ret = 0
for i in range(N):
	if isDivided[i] == False:
		ret += 1
print(ret)


N = int(input())
S = list(map(int, input().split()))
colors = [S[0]]
for i in range(1, N):
	x = 2
	j = 0
	while j < len(colors):
		if S[i] % colors[j] == 0:
			x = 0
		elif x == 2 and colors[j] % S[i] == 0:
			colors = colors[:j] + [S[i]] + colors[j + 1:]
			x = 1
		elif x == 1 and colors[j] % S[i] == 0:
			colors.pop(j)
			j -= 1
		j += 1
	if x == 2:
		colors.append(S[i])
print(len(colors))


n = int(input())
arr = list(map(int, input().split()))
arr.sort(reverse=True)
cnt = 0
while arr:
	tmp = []
	num = arr.pop()
	cnt += 1
	for a in arr:
		if a % num:
			tmp.append(a)
	arr = tmp
print(cnt)


n = int(input())
a = list(map(int, input().split(' ')))
a.sort()
mins = [a[0]]
count = 1
for i in range(1, n):
	for j in range(count):
		if a[i] % mins[j] == 0:
			break
	else:
		count += 1
		mins.append(a[i])
print(count)


a = [0] * 101
ans = 0
n = input()
for i in input().split():
	a[int(i)] = 1
for i in range(1, 101):
	if a[i]:
		ans += 1
		for j in range(i, 101, i):
			a[j] = 0
print(ans)


n = int(input())
a = sorted(list(map(int, input().split())))
cnt = 0
while len(a) > 0:
	cnt += 1
	y = a[0]
	a = [x for x in a if x % y != 0]
print(cnt)


import math
t = int(input())
l = [int(i) for i in input().split()]
a = [0 for i in range(t)]
l = sorted(l)
ans = 0
for i in range(t):
	if a[i]:
		continue
	a[i] = 1
	ans += 1
	for j in range(i + 1, t):
		if l[j] % l[i] == 0:
			a[j] = 1
print(ans)


import collections
import bisect
import random
import logging
import math

def solve(N, A):
	A.sort()
	cnt = 0
	while A:
		cnt += 1
		A = list(filter(lambda x: x % A[0] != 0, A))
	return cnt

def run():
	N = int(input())
	A = list(map(int, input().split()))
	re = solve(N, A)
	print('{}'.format(re))

def test():
	logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
	print(solve(6, list(map(int, '10 2 3 5 4 2'.split()))))
	print(solve(8, list(map(int, '7 6 5 4 3 2 2 3'.split()))))
run()


number = int(input())
list1 = list(map(int, input().split()))
list1 = sorted(list1)
i = 0
count = 0
final = len(list1)
while final > 0:
	arr = [0] * final
	for i in range(len(list1)):
		d = list1[0]
		arr[i] = list1[i] % d
	length = len(list1)
	r = 0
	while r < length:
		if arr[r] == 0:
			list1.remove(list1[r])
			arr.remove(arr[r])
			length -= 1
			continue
		r += 1
	final = len(list1)
	count += 1
print(count)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))
n = get_int()
lst = sorted(get_int_list())
count = 1
temp = []
temp.append(lst[0])

def check(n):
	for i in range(len(temp)):
		if n % temp[i] == 0:
			return 0
	temp.append(n)
	return 1
for i in range(1, n):
	count += check(lst[i])
print(count)


def calc():
	print()

def main():
	n: int = int(input())
	arr: list = list(map(int, input().split()))
	arr.sort(reverse=True)
	ans: int = 0
	temp: list = []
	while arr:
		mn: int = arr.pop()
		ans += 1
		for i in arr:
			if i % mn == 0:
				temp.append(i)
		for i in temp:
			arr.remove(i)
		temp.clear()
	print(ans)
main()


n = int(input())
l = list(set(map(int, input().split())))
n = len(l)
count = 0
while n:
	i = 0
	m = min(l)
	l.remove(m)
	count += 1
	n -= 1
	while i < n:
		if l[i] % m == 0:
			l.remove(l[i])
			n -= 1
		else:
			i += 1
print(count)


def solve():
	global a
	a.sort()
	k = 0
	m = [False for _ in range(n)]
	for i in range(n):
		if not m[i]:
			k += 1
			for j in range(i + 1, n):
				if not m[j] and a[j] % a[i] == 0:
					m[j] = True
	return k

def main():
	global n, a
	n = int(input())
	a = list(map(int, input().split()))
	print(solve())
main()


import math
t = input()
t = int(t)
tints = input()
tints = tints.split()
tints = [int(i) for i in tints]
ncol = 0
while True:
	Min = min(tints)
	tints = [i for i in tints if i % Min != 0]
	ncol = ncol + 1
	if len(tints) == 0:
		break
print(ncol)


N = int(input())
lst = list(map(int, input().split()))
s = {}
s = set(lst)
x = []
for i in s:
	x.append(i)
if len(x) == 1:
	print(1)
elif len(x) > 1:
	count = 0
	while len(lst) != 0:
		x.sort()
		c = x[0]
		j = 0
		while j < len(x):
			if x[j] % c == 0:
				flag = 0
				x.remove(x[j])
				j = -1
			j += 1
		if flag == 0:
			count += 1
		if len(x) == 0:
			break
	print(count)


import sys
import math
fileoperation = 0
if fileoperation:
	orig_stdout = sys.stdout
	orig_stdin = sys.stdin
	inputfile = open('W:/Competitive Programming/input.txt', 'r')
	outputfile = open('W:/Competitive Programming/output.txt', 'w')
	sys.stdin = inputfile
	sys.stdout = outputfile
mod = 1000000007

def nospace(l):
	ans = ''.join((str(i) for i in l))
	return ans
t = 1
for tt in range(t):
	n = int(input())
	a = list(map(int, sys.stdin.readline().split(' ')))
	a.sort()
	i = 0
	ans = 0
	while i < len(a):
		if a[i]:
			ans += 1
			j = i + 1
			while j < n:
				if a[j] % a[i] == 0:
					a[j] = 0
				j += 1
		i += 1
	print(ans)
if fileoperation:
	sys.stdout = orig_stdout
	sys.stdin = orig_stdin
	inputfile.close()
	outputfile.close()


import math
n = int(input())
arr = list(map(int, input().split()))
arr = list(sorted(arr))
visited = [False for _ in range(n)]
count = 0
for i in range(n):
	key = arr[i]
	flag = False
	for j in range(n):
		if arr[j] % key == 0 and visited[j] == False:
			visited[j] = True
			flag = True
	if flag:
		count += 1
print(count)


import sys
pin = sys.stdin.readline
pout = sys.stdout.write
ran = range
t = int(pin())
total = list(map(int, pin().split()))
count = 0
maxe = max(total) + 1
while min(total) != maxe:
	mine = min(total)
	count = count + 1
	for i in ran(t):
		if total[i] % mine == 0:
			total[i] = maxe
print(count)


n = int(input())
l = list(map(int, input().split()))
c = 0
while len(l) != 0:
	x = min(l)
	i = 0
	while i < len(l):
		if l[i] % x == 0:
			l.remove(l[i])
		else:
			i += 1
	c += 1
print(c)


n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
if n == 1:
	print(1)
else:
	for i in range(n):
		if l[i] == 0:
			continue
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				l[j] = 0
		l[i] = 0
		ans += 1
	print(ans)


hat = int(input())
lst = sorted([int(x) for x in input().split()])
lst2 = [0] * hat
counter = 0
p = 0
for i in range(hat):
	if lst2[i] == 1:
		continue
	for j in range(hat):
		if lst[j] % lst[i] == 0:
			lst2[j] = 1
	counter += 1
print(counter)


n = int(input())
l = list(map(int, input().split()))
dup = 1
while True:
	i = 0
	chuj = 0
	while i < len(l):
		if len(l) == 0:
			dup = 0
			break
		j = 0
		while j < len(l) and i < len(l):
			if len(l) == 0:
				dup = 0
				break
			if j == i:
				j += 1
				continue
			if l[j] % l[i] == 0:
				l.pop(j)
				j -= 1
				chuj = 1
			j += 1
		i += 1
	if chuj == 0 or len(l) == 0 or dup == 0:
		break
print(len(l))


from sys import stdin, stdout
n = int(stdin.readline().rstrip())
l = list(map(int, stdin.readline().split()))
l.sort()
c = 0
f = 0
for i in range(n):
	if l[i] == -1:
		continue
	for j in range(i + 1, n):
		if l[j] % l[i] == 0:
			l[j] = -1
	c += 1
stdout.write(str(c) + ' ')


input()
a = set(map(int, input().split()))
r = 0
while a:
	r += 1
	m = min(a)
	for x in range(m, 101, m):
		a -= {x}
print(r)


n = int(input())
l = sorted(list(map(int, input().split())))
z = []
j = 0
for k in range(n):
	i = 0
	if len(l) != 0:
		temp = l[0]
		z.append(temp)
		l.pop(0)
	while i != len(l) and len(l) != 0:
		if l[i] % temp == 0:
			l.pop(i)
		else:
			i += 1
print(len(z))


def solve():
	global a
	a.sort()
	j = 0
	while a:
		p = a[0]
		b = a[:]
		k = 0
		for (i, v) in enumerate(a):
			if v % p == 0:
				b.remove(v)
				k += 1
		if k:
			j += 1
		a = b
	return j

def main():
	global n, a
	n = int(input())
	a = list(map(int, input().split()))
	print(solve())
main()


n = int(input())
arr = [int(x) for x in input().split()]
ans = 0
while arr:
	mini = min(arr)
	arr = [x for x in arr if x % mini]
	ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
c = 0
while a:
	r = a.pop()
	c += 1
	l = len(a) - 1
	while l != -1:
		if a[l] % r == 0:
			l -= 1
			a.pop(l + 1)
		else:
			l -= 1
print(c)


n = int(input())
l = [0] * 101
a = list(map(int, input().split()))
for i in a:
	l[i] = 1
count = 0
for i in range(101):
	if l[i] == 1:
		count += 1
		for j in range(2 * i, 101, i):
			l[j] = 0
print(count)


n = int(input())
l = [int(i) for i in input().split()]
mul = []
l.sort()
mini = 10 ** 9
vis = [0] * n
from collections import defaultdict
for i in range(n):
	mul = defaultdict(int)
	if vis[i] == 0:
		for j in range(i, n):
			if vis[j] != 1 and l[j] % l[i] == 0:
				mul[i] += 1
				vis[j] = i + 1
print(len(set(vis)))


MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import *
(n,) = I()
l = I()
v = [0] * n
l.sort()
ans = 0
for i in range(n):
	if not v[i]:
		ans += 1
		for j in range(i, n):
			if l[j] % l[i] == 0:
				v[j] = ans
print(ans)


n = int(input())
a = [int(s) for s in input().split(' ')]
a.sort()
c = 0
while len(a) > 0:
	a = [b for b in a if b % a[0] != 0]
	c += 1
print(c)


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
tot = 0
d = {}
for i in range(len(a)):
	if a[i] not in d:
		tot += 1
		for j in range(i + 1, len(a), 1):
			if a[j] % a[i] == 0:
				d[a[j]] = 1
print(tot)


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def run():
	n = eval(input())
	nums = list(map(int, input().split()))
	c = 0
	remaining = nums
	while True and len(remaining) > 0:
		mn = min(remaining)
		remaining2 = []
		for i in remaining:
			if i % mn != 0:
				remaining2.append(i)
		c += 1
		if len(remaining2) > 0:
			remaining = remaining2
		else:
			break
	print(c)
run()


import sys, math

def main():

	def input():
		return sys.stdin.readline()[:-1]
	n = int(input())
	a = sorted(list(map(int, input().split())))
	L = []
	for e in a:
		f = 0
		for l in L:
			if e % l == 0:
				f = 1
				break
		if f == 0:
			L.append(e)
	print(len(L))
main()


n = int(input())
l = sorted(list(set(map(int, input().split()))))
n = len(l)
m = [0] * n
for i in range(n):
	for j in range(i + 1, n):
		if l[j] % l[i] == 0 and m[j] != 1 and (m[i] != 1):
			m[j] = 1
print(m.count(0))


n = int(input())
ls = [int(a) for a in input().split()]
ls.sort()
an = [ls[0]]
while len(ls) > 0:
	found = False
	for j in range(len(an)):
		if ls[0] % an[j] == 0:
			ls.pop(0)
			found = True
			break
	if found == False:
		an.append(ls[0])
		ls.pop(0)
print(len(an))


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
used = [False] * n
cnt = 0
ans = 0
for i in range(n):
	if used[i]:
		continue
	ans += 1
	for j in range(n):
		if a[j] % a[i] == 0 and (not used[j]):
			used[j] = True
			cnt += 1
	if cnt == n:
		print(ans)
		exit()


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
vis = [0] * 101
ans = 0
for num in arr:
	if vis[num] == 0:
		ans += 1
		i = num
		while i <= 100:
			vis[i] = 1
			i += num
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
k = 0
for i in range(n):
	if a[i]:
		k += 1
		for j in range(i + 1, n):
			if a[j] and a[j] % a[i] == 0:
				a[j] = 0
print(k)


n = int(input())
a = set(map(int, input().split()))
print(sum((all((x % y for y in a - {x})) for x in a)))


from math import gcd
n = int(input())
l = list(map(int, input().split()))
count = 0
l = sorted(l)
while l != []:
	p = l[0]
	q = []
	for i in l:
		if i % p == 0:
			continue
		else:
			q.append(i)
	count += 1
	l = q
print(count)


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
c = 0
for i in range(n - 1):
	if a[i] != 0:
		for j in range(i + 1, n):
			if a[j] != 0:
				if a[j] % a[i] == 0:
					a[j] = 0
		c += 1
if a[-1] != 0:
	c += 1
print(c)


n = int(input())
l = list(map(int, input().split()))
l.sort()
k = cnt = 0
while l != []:
	k = l[0]
	cnt += 1
	x = 0
	for i in range(0, len(l)):
		if l[x] % k == 0:
			l.pop(x)
		else:
			x += 1
print(cnt)


n = int(input())
a = list(map(int, input().split()))
a.sort()
count = 0
count1 = 0
while 1:
	i = 0
	b = []
	for j in range(i + 1, n):
		flag = 0
		if a[j] % a[i] == 0:
			flag = 1
		if flag == 0:
			b.append(a[j])
	a = b
	count1 += 1
	n = len(b)
	if b == []:
		break
print(count1)


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
n = int(input())
a = sorted(list(map(int, input().split())))
b = [0] * n
ans = 0
for i in range(n):
	if b[i] == 1:
		continue
	start = a[i]
	b[i] = 1
	for j in range(i + 1, n):
		if b[j] == 1:
			continue
		if a[j] % start == 0:
			b[j] = 1
	ans += 1
print(ans)


n = int(input())
l = []
l = list(map(int, input().split()))
l = list(set(l))
l = sorted(l)
check = []
what = []
for i in range(len(l)):
	if l[i] not in check:
		check.append(l[i])
		temp = []
		temp.append(l[i])
		for j in range(i + 1, len(l)):
			if l[j] not in check:
				if l[j] % l[i] == 0:
					temp.append(l[j])
					check.append(l[j])
		what.append(temp)
print(len(what))


n = int(input())
li = sorted(list(map(int, input().split())))
li2 = [0] * n
ans = 1
for i in range(n):
	if li2[i] == 0:
		for j in range(i, n):
			if li[j] % li[i] == 0:
				li2[j] = ans
		ans += 1
print(max(li2))


n = int(input())
a = list(map(int, input().split()))
c = 0
while len(a) > 0:
	k = min(a)
	c += 1
	a = [d for d in a if d % k != 0]
print(c)


R = lambda : map(int, input().split())
n = int(input())
L = sorted(R())
d = {}
f = [0] * 101
for i in L:
	f[i] = 1
res = 0
for i in range(1, 101):
	if f[i] == 1:
		res += 1
		for j in L:
			if j % i == 0 and f[j] == 1:
				f[j] = 0
print(res)


def paintNumbers(arr):
	seen = set()
	arr.sort()
	distinctColors = 0
	for num in arr:
		if num not in seen:
			distinctColors += 1
			for i in range(2 * num, max(arr) + 1, num):
				seen.add(i)
		seen.add(num)
	return distinctColors
n = int(input())
nums = list(map(int, input().split()))
print(paintNumbers(nums))


ans = 0
n = int(input())
new = [True] * 101
for a in sorted(map(int, input().split())):
	if new[a]:
		ans += 1
		for b in range(a, 101, a):
			new[b] = False
print(ans)


n = int(input())
A = list(map(int, input().split()))
A.sort()
small = [A[0]]
for i in range(1, n):
	flag = 1
	for j in range(len(small)):
		if A[i] % small[j] == 0:
			flag = 0
			break
	if flag == 1:
		small.append(A[i])
if n == 0:
	print('0')
else:
	print(len(small))


a = int(input())
n = list(map(int, input().split()))
n = sorted(n)
count = 0
for i in range(len(n)):
	if n[i] == -1:
		continue
	count = count + 1
	l = n[i]
	for j in range(i, len(n)):
		if n[j] % l == 0:
			n[j] = -1
print(count)


n = int(input())
vals = sorted(map(int, input().split(' ')))
out = 0
loop = True
while loop:
	out += 1
	cur_val = vals[0]
	del vals[0]
	n -= 1
	if n == 0:
		break
	i = 0
	for cur_count in range(n):
		target_val = vals[i]
		if target_val % cur_val == 0:
			del vals[i]
			n -= 1
			if n == 0:
				loop = False
				break
		else:
			i += 1
print(out)


n = int(input())
a = list(map(int, input().split()))
a.sort()
if 1 in a:
	print(1)
else:
	flag = 0
	for i in range(len(a)):
		if sum(a) == len(a):
			break
		if a[i] != 1:
			for j in range(i + 1, len(a)):
				if a[j] % a[i] == 0:
					a[j] = 1
			a[i] = 1
			flag += 1
	print(flag)


n = int(input())
l = list(map(int, input().split()))
l.sort()
visited = [0] * n
count = 0
for i in range(n):
	if visited[i] == 0:
		count = count + 1
		visited[i] = 1
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				visited[j] = 1
print(count)


seqLen = int(input())
seq = input().split(' ')
for (i, item) in enumerate(seq):
	seq[i] = int(seq[i])
result = 0
while len(seq) > 0:
	minNum = 100500
	minItemId = 0
	for (i, item) in enumerate(seq):
		if item < minNum:
			minNum = item
			minItemId = i
	itemsToDel = [minItemId]
	for (i, item) in enumerate(seq):
		if i == minItemId:
			continue
		if item % minNum == 0:
			itemsToDel.append(i)
	for itemId in sorted(itemsToDel, reverse=True):
		del seq[itemId]
	result += 1
print(result)


n = int(input())
l = list(map(int, input().split()))
l.sort()
color = 0
extra = []
i = 0
while True:
	for j in range(len(l)):
		if l[j] % l[i] == 0:
			extra.append(l[j])
	for k in extra:
		if k in l:
			l.remove(k)
	color = color + 1
	i = 0
	if len(l) == 0:
		break
print(color)


n = int(input())
l = [int(i) for i in input().split()]
l.sort()
color = 0
cols = [-1 for i in range(len(l))]
for (i, item) in enumerate(l):
	if cols[i] != -1:
		continue
	color += 1
	cols[i] = color
	for (j, jtem) in enumerate(l):
		if cols[j] == -1 and jtem % item == 0:
			cols[j] = color
print(color)


n = int(input())
data = input().split()
data.sort()
datas = []
datas2 = []
for i in range(len(data)):
	if data[i] != data[(i + 1) % len(data)]:
		datas.append(int(data[i]))
for i in datas:
	datas2.append(i)
datas.sort()
datas2.sort()
for i in range(len(datas)):
	for j in range(len(datas) - 1):
		if datas[j + 1] > datas[i]:
			if datas[j + 1] % datas[i] == 0:
				if datas[j + 1] in datas2:
					datas2.remove(datas[j + 1])
if len(datas2) == 0 or len(datas2) == 1:
	print('1')
else:
	print(len(datas2))


n = int(input())
a = [int(x) for x in input().split()]
ans = 0
while min(a) < 1001:
	ans += 1
	r = min(a)
	for i in range(len(a)):
		if a[i] != 1001:
			if a[i] % r == 0:
				a[i] = 1001
print(ans)


n = int(input())
a = sorted(map(int, input().split()))
s = {a[0]}
ans = 1
for i in range(1, n):
	for item in s:
		if a[i] % item == 0:
			break
	else:
		s.add(a[i])
		ans += 1
print(ans)


n = int(input())
data = [int(i) for i in input().split()]
data.sort()
ans = [0] * n
col = 0
for i in range(n):
	if ans[i] == 0:
		col += 1
		ans[i] = 1
		d = data[i]
		for j in range(i + 1, n):
			if data[j] % d == 0:
				ans[j] = 1
print(col)


n = int(input())
u = list(map(int, input().split()))
u.sort()
a = [0] * n
ans = 0
k = 0
while k < n:
	ans += 1
	i = 0
	while a[i] == 1:
		i += 1
	x = u[i]
	a[i] = 1
	k += 1
	for i in range(i + 1, n):
		if a[i] == 0 and u[i] % x == 0:
			k += 1
			a[i] = 1
print(ans)


I = lambda : int(input())
IL = lambda : list(map(int, input().split()))
n = I()
A = IL()
ans = 0
for i in sorted(set(A)):
	if any((a % i == 0 for a in A)):
		ans += 1
		A = [a for a in A if a % i]
print(ans)


from sys import stdin, stdout
from collections import Counter
import math

def rsingle_int():
	return int(stdin.readline().rstrip())

def rmult_int():
	return [int(x) for x in stdin.readline().rstrip().split()]

def rmult_str():
	return stdin.readline().rstrip().split()

def r_str():
	return stdin.readline().rstrip()

def rsingle_char():
	return stdin.read(1)

def sortFirst(val):
	return val[0]

def is_div(roots, a):
	res = False
	for root in roots:
		if a % root == 0:
			res = True
			break
	return res

def main():
	n = rsingle_int()
	a = rmult_int()
	a.sort()
	roots = [a[0]]
	for i in range(1, n):
		if not is_div(roots, a[i]):
			roots.append(a[i])
	print(len(roots))
main()


n = int(input())
l1 = list(map(int, input().split()))
ans = 0
l1.sort()
visited = [0] * n
for i in range(n):
	if visited[i] == 1:
		continue
	visited[i] = 1
	ans += 1
	for j in range(i + 1, n):
		if visited[j] == 0 and l1[j] % l1[i] == 0:
			visited[j] = 1
print(ans)


n = int(input())
a = [0] * 101
s = input().split()
for _ in range(n):
	a[int(s[_])] = 1
for _ in range(101):
	if a[_] == 1:
		for i in range(_ + _, 101, _):
			a[i] = 0
print(sum(a))


n = int(input())
a = [int(s) for s in input().split(' ')]
a.sort()
check = [0] * n
ans = 0
for i in range(n):
	if not check[i]:
		ans += 1
		for j in range(i, n):
			if a[j] % a[i] == 0:
				check[j] = 1
print(ans)


n = int(input())
lst = list(map(int, input().split()))
lst.sort()
mark = {x: False for (i, x) in enumerate(lst)}
res = 0
for (i, x) in enumerate(lst):
	if mark[x] == False:
		res += 1
		mark[x] = True
		for j in range(i + 1, n):
			y = lst[j]
			if y % x == 0:
				if mark[y] == False:
					mark[y] = True
print(res)


n = int(input())
a = [int(i) for i in input().split()]
a = sorted(a)
b = [] * n
cnt = 0
for i in range(n):
	if a[i] not in b:
		for j in range(i + 1, n):
			if a[j] not in b:
				if a[j] % a[i] == 0:
					b.append(a[j])
		cnt += 1
print(cnt)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 0
b = [0] * n
for i in range(n):
	if b[i] == 0:
		ans += 1
		for j in range(i, n):
			if a[j] % a[i] == 0:
				b[j] = 1
print(ans)


n = int(input())
x = [*map(int, input().split())]
x = sorted(x)
color = 0
l = len(x)
while l > 0:
	a = x[0]
	x.remove(a)
	l = len(x)
	j = 0
	while j < l:
		if x[j] % a == 0:
			x.remove(x[j])
			l = len(x)
			j = 0
		else:
			j += 1
	color += 1
print(color)


inp = lambda : map(int, input().split())
n = int(input())
a = list(inp())
a.sort()
d = {}
for i in a:
	d[i] = True
ans = 0
for i in a:
	if d[i]:
		ans += 1
		wk1 = i
		while wk1 <= max(a):
			if wk1 in d:
				d[wk1] = False
			wk1 += i
print(ans)


n = int(input())
l = list(map(int, input().split()))
l.sort()
d = {}
mark = [0] * n
for i in range(n):
	if not mark[i]:
		d[l[i]] = 1
		mark[i] = 1
		for j in range(0, n):
			if not mark[j]:
				if l[j] % l[i] == 0:
					d[l[i]] += 1
					mark[j] = 1
print(len(d))


n = int(input())
a = list(map(int, input().split()))
a.sort()
lst = []
ans = 0
for i in range(len(a)):
	if a[i] not in lst:
		for j in range(len(lst)):
			if a[i] % lst[j] == 0:
				break
		else:
			lst.append(a[i])
print(len(lst))


n = int(input())
numbers = sorted(map(int, input().split()))
count = 0
ans = set()
for i in range(n):
	if numbers[i] is not None:
		for j in range(i + 1, n):
			if numbers[j] is not None:
				if numbers[j] % numbers[i] == 0:
					numbers[j] = None
					count += 1
					ans.add(numbers[i])
	if count == n:
		break
for i in numbers:
	if i is not None:
		ans.add(i)
print(len(ans))


n = int(input())
al = list(map(int, input().split()))
al.sort()
c = 0
for (i, d) in enumerate(al):
	if d is None:
		continue
	c += 1
	for j in range(i + 1, n):
		if al[j] is not None and al[j] % d == 0:
			al[j] = None
print(c)


n = int(input())
a = sorted(list(map(int, input().split())))
b = []
while len(a):
	b.append(a[0])
	a = list(set([a[0] if i % a[0] == 0 else i for i in a]))
	del a[0]
print(len(b))


n = int(input())
l = [*map(int, input().split())]
l.sort()
cnt = 0
for i in range(n):
	if l[i] != -1:
		cnt += 1
		for j in range(i + 1, n):
			if l[j] != -1 and l[j] % l[i] == 0:
				l[j] = -1
print(cnt)


from bisect import insort

def main():
	n = int(input())
	a = sorted([int(i) for i in input().split()])
	q = [[a[0]]]
	k = 1
	for i in range(1, n):
		f = False
		for ar in q:
			if ar[0] >= a[i] and ar[0] % a[i] == 0:
				ar.insert(0, a[i])
				f = True
				break
			elif ar[0] < a[i] and a[i] % ar[0] == 0:
				insort(ar, a[i])
				f = True
				break
		if f == False:
			q.append([a[i]])
			k += 1
	print(k)
main()


n = int(input())
a = list(map(int, input().split()))
delitel = dict()
i = 0
while i < len(a):
	delitel[a[i]] = 0
	for j in a:
		if j % a[i] == 0:
			delitel[a[i]] += 1
	i += 1
i = 0
its = 0
nums = 0
numbers = list(a)
bigi = 0
biggest = 0
while True:
	if len(a) == 0:
		break
	biggest = max(delitel, key=delitel.get)
	nums = 0
	i = 0
	while i < len(a):
		if a[i] % biggest == 0:
			a.pop(i)
			nums += 1
		else:
			i += 1
	if nums > 0:
		its += 1
	delitel.pop(biggest)
print(its)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
n = rint()
a = sorted(rints())
c = 0
while a:
	c += 1
	mi = min(a)
	newa = []
	for ai in a:
		if ai % mi:
			newa.append(ai)
	a = newa
print(c)


import sys
n = int(input())
orgnums = input()
nums = orgnums.split(' ')
x = []
for i in range(n):
	nums[i] = int(nums[i])
nums.sort()
x.append(nums[0])
for i in range(1, n):
	flag = 1
	for j in x:
		if nums[i] % j == 0:
			flag = 0
	if flag:
		x.append(nums[i])
print(len(x))


n = int(input())
l = list(map(int, input().split()))
l.sort()
v = [False for i in range(n)]
ans = 0
i = 0
while i < n:
	if v[i] == False:
		ans += 1
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				v[j] = True
	i += 1
print(ans)


n = int(input())
n = list(map(int, input().split()))
n.sort()
flow = []
count = 0
size = len(n)

def recurse(array):
	if not len(array):
		return
	flow = []
	for i in range(1, len(array)):
		if array[i] % array[0] != 0:
			flow.append(array[i])
	global count
	count += 1
	recurse(flow)
recurse(n)
print(count)


n = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 1
for i in range(1, n):
	ok = False
	for j in range(i):
		if A[i] % A[j] == 0:
			ok = True
	if not ok:
		ans += 1
print(ans)


n = int(input())
arr = list(map(int, input().split()))
elem = {}
arr.sort()
for i in arr:
	f = 0
	for k in elem:
		if i % k == 0:
			elem[k] += 1
			f = 1
			break
	if not f:
		elem[i] = 1
print(len(elem))


n = int(input())
arr = list(map(int, input().split()))
new_arr = arr.copy()
arr.sort()
index = 0
count = 0
while len(arr) > 0:
	flag = 0
	for i in arr:
		if i % arr[index] == 0:
			flag = 1
			new_arr.remove(i)
	if flag == 1:
		count += 1
	arr = new_arr.copy()
	arr.sort()
print(count)


n = int(input())
l = list(map(int, input().split()))
l.sort()
cou = 0
for i in range(len(l)):
	if l[i] != -1:
		cou += 1
		for j in range(i + 1, len(l)):
			if l[j] % l[i] == 0 and l[j] != -1:
				l[j] = -1
		l[i] = -1
print(cou)


import os

def f(arr):
	arr.sort()
	result = []
	result.append(arr[0])
	for i in range(1, len(arr)):
		flag = False
		for j in range(len(result)):
			if arr[i] % result[j] == 0:
				flag = True
				break
		if not flag:
			result.append(arr[i])
	return len(result)
if os.environ.get('DEBUG', False):
	print(f'{f([10, 2, 3, 5, 4, 2])} = 3')
	print(f'{f([100, 100, 100, 100])} = 1')
	print(f'{f([7, 6, 5, 4, 3, 2, 2, 3])} = 4')
else:
	int(input())
	print(f(list(map(int, input().split()))))


n = int(input())
l = set(map(int, input().split()))
r = list(l)
r.sort()
p = []
s = []
t = len(r)
for i in range(len(r)):
	c = 0
	for j in range(len(r)):
		if r[j] not in p:
			if r[j] % r[i] == 0:
				c += 1
				p.append(r[j])
	if c > 0:
		s.append(c)
	if len(p) == t:
		break
if len(r) == 1:
	print('1')
else:
	print(len(s))


N = int(input())
data = input()
split = data.split(' ')
numbers = []
for x in split:
	numbers.append(int(x))
numbers.sort()
count = 0
colored = 0
while colored != N:
	for i in range(N):
		if numbers[i] != -1:
			divisor = numbers[i]
			numbers[i] = -1
			position = i
			colored = colored + 1
			count = count + 1
			break
	for i in range(position, N):
		if numbers[i] % divisor == 0 and numbers[i] != -1:
			numbers[i] = -1
			colored = colored + 1
print(count)


from math import *
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
l = [True for i in range(n)]
c = 0
for i in range(n):
	if a[i] == 0 or l[i] == False:
		continue
	for j in range(i + 1, n):
		if a[j] % a[i] == 0:
			l[j] = False
	c += 1
print(c)


def paintnumbers(x):
	i = 0
	if len(x) == 0:
		return 0
	while True:
		j = []
		for k in range(i + 1, len(x)):
			if x[k] % x[i] != 0:
				j.append(x[k])
		if len(j) == 0:
			return i + 1
		if len(j) == len(x) - i - 1:
			i += 1
		else:
			return i + 1 + paintnumbers(j)
l = int(input())
y = list(map(int, input().split()))
y.sort()
print(paintnumbers(y))


n = int(input())
a = list(map(int, input().split()))
c = 1
b = [0 for i in range(n)]
a.sort()
for i in range(n):
	if b[i] == 0:
		b[i] = c
	for j in range(i + 1, n):
		if a[j] % a[i] == 0:
			b[j] = 1
	c += 1
print(len(set(b)))


n = int(input())
l = list(map(int, input().split()))
s = set(l)
p = len(s)
if 1 in s or p == 1:
	print(1)
else:
	le = max(s)
	pk = [0] * (max(s) + 1)
	for i in l:
		pk[i] = 1
	for i in sorted(l):
		if pk[i]:
			p = i * 2
			while p <= le:
				pk[p] = 0
				p += i
	print(pk.count(1))


a = int(input())
b = set(map(int, input().split()))
cnt = 0
while b:
	c = min(list(b))
	for i in list(b):
		if i % c == 0:
			b.remove(i)
	cnt += 1
print(cnt)


n = int(input())
a = [int(i) for i in input().split()]
a = set(a)
a = list(sorted(a))
s = set()
for i in range(0, len(a)):
	for j in range(i, len(a)):
		if a[j] % a[i] == 0:
			a[j] = a[i]
			s.add(a[j])
print(len(s))


(n, num) = (int(input()), list(sorted(list(set(map(int, input().split()))))))
for (i, val) in enumerate(num):
	if val != -1:
		for j in range(i + 1, len(num)):
			if num[j] % val == 0:
				num[j] = -1
print(len(num) - num.count(-1))


n = int(input())
l = list(map(int, input().split()))
cnt = 0
while len(l) > 0:
	min_no = min(l)
	idx = 0
	found = False
	while idx < len(l):
		if l[idx] % min_no == 0:
			del l[idx]
			found = True
		else:
			idx += 1
	if found:
		cnt += 1
	else:
		l.remove(min_no)
		cnt += 1
print(cnt)


n = int(input())
l = list(map(int, input().split()))
l.sort()
i = 0
c = 0
while i < len(l):
	c += 1
	j = i + 1
	while j < len(l):
		if l[j] % l[i] == 0:
			l.remove(l[j])
			j = j - 1
		j = j + 1
	l.remove(l[i])
print(c)


n = int(input())
a = sorted(list(map(int, input().split())))
m = [a[0]]
ml = 1
for i in range(n):
	k = 0
	for j in range(ml):
		if a[i] % m[j] != 0:
			k = 1
		else:
			k = 0
			break
	if k == 1:
		m.append(a[i])
		ml = ml + 1
print(ml)


n = int(input())
x = [int(n) for n in input().split()]
x = sorted(x)
a = {}
ctr = 0
for i in x:
	a[i] = 0
for i in range(0, n):
	c = 0
	for j in range(i, n):
		if x[j] % x[i] == 0 and a[x[j]] == 0:
			c += 1
			a[x[j]] = 1
	if c > 0:
		ctr += 1
print(ctr)


n = int(input())
a = sorted(map(int, input().split()))
d = dict()
for i in a:
	d[i] = False
for i in range(n):
	if d[a[i]] != False:
		pass
	for j in range(i + 1, n):
		if a[j] != a[i] and (not d[a[j]]) and (a[j] % a[i] == 0):
			d[a[j]] = a[i]
ans = 0
for i in d.values():
	if i == False:
		ans += 1
print(ans)


input()
cs = set(map(int, input().split()))
cnt = 0
while cs:
	cnt += 1
	c = min(cs)
	cs.remove(c)
	arr = []
	for col in cs:
		if not col % c:
			arr.append(col)
	for col in arr:
		cs.remove(col)
print(cnt)


n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
u = [0] * (n + 1)
for i in range(n):
	if u[i] == 0:
		ans += 1
	for j in range(i, n):
		if a[j] % a[i] == 0:
			u[j] = 1
print(ans)


n = int(input())
singleList = [int(x) for x in input().split()]
singleList.sort()
truthList = [False] * n
answer = 0
for i in range(0, n):
	if not truthList[i]:
		for j in range(i, n):
			if singleList[j] % singleList[i] == 0:
				truthList[j] = True
		answer += 1
print(answer)


n = int(input())
l = list(map(int, input().split()))
t = []
ans = 0
l.sort()
for i in range(n):
	if l[i] not in t:
		t.append(l[i])
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				t.append(l[j])
		ans += 1
	else:
		pass
print(ans)


n = int(input())
a = list(map(int, input().split()))
ans = 0
checked = [0] * n
a.sort()
for i in range(n):
	if checked[i] == 1:
		continue
	for j in range(n):
		if a[j] >= a[i] and a[j] % a[i] == 0 and (checked[j] != 1):
			checked[j] = 1
	ans += 1
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
flag = [0 for i in range(n)]
a.sort()
c = 0
for i in range(n):
	if flag[i] == 1:
		continue
	for j in range(i + 1, n):
		if a[j] % a[i] == 0:
			flag[j] = 1
	c += 1
	flag[i] = 1
print(c)


n = int(input())
l = set(map(int, input().split()))
count = 0
for i in l:
	if sum((1 for x in l if i % x == 0)) == 1:
		count += 1
print(count)


length = input()
numb = input()
x = numb.split(' ')
numbers = list(map(int, x))
numbers.sort()
y = 0
numbers_removed = 0
while True:
	x = numbers[0]
	numbers_removed = 0
	for i in numbers[:]:
		if i % x == 0:
			numbers.remove(i)
			numbers_removed += 1
	if len(numbers) == 1:
		y += 2
		break
	elif len(numbers) == 0:
		y += 1
		break
	else:
		y += 1
print(y)


n = int(input())
a = list(sorted(map(int, input().split())))
ans = 0
for i in range(n):
	ok = False
	for f in range(i):
		if a[i] % a[f] != 0:
			continue
		ok = True
		break
	ans += int(not ok)
print(ans)


count = int(input())
numbers = sorted(list(map(int, input().split())))
quantity = 0
position = 0
current = 0
tmp = []
if count != 0:
	while True:
		if numbers[position] not in tmp:
			current = numbers[position]
		else:
			position += 1
			if position == count:
				break
			continue
		quantity += 1
		for i in numbers:
			if i not in tmp:
				if i % current == 0:
					tmp.append(i)
		if not numbers:
			break
	print(quantity)
else:
	print(0)


n = int(input())
a = [int(s) for s in input().split()]
if len(a) != n:
	quit()
ans = 0
while len(a) > 0:
	m = min(a)
	ans += 1
	for i in range(len(a)):
		if a[i] % m == 0:
			a[i] = -1
	while -1 in a:
		a.remove(-1)
print(ans)


input()
a = set(map(int, input().split()))
z = 0
while a:
	a = a.difference(set(range(min(a), max(a) + 1, min(a))))
	z += 1
print(z)


n = int(input())
a = [0] * 101
c = map(int, input().split())
for x in c:
	a[x] = 1
n = 0
for i in range(1, 101):
	if a[i] == 1:
		n += 1
		for j in range(i, 101, i):
			a[j] = 0
print(n)


n = int(input())
l = list(map(int, input().split()))
l.sort()
vis = [0] * n
ans = 0
for i in range(n):
	if vis[i] == 0:
		ans += 1
		x = l[i]
		for j in range(n):
			if l[j] % x == 0:
				vis[j] = 1
print(ans)


from bisect import insort as ins
from bisect import bisect_left as bl
from collections import defaultdict as dd
n = int(input())
l = [int(i) for i in input().split()]
s = list(set(l))
s.sort()
n = len(s)
ans = set()
x = [i for i in range(n)]
x = set(x)
for i in range(n):
	for j in range(i, n):
		if s[j] % s[i] == 0:
			if j in x:
				x.remove(j)
				ans.add(i)
print(len(ans))


fast = lambda : stdin.readline().strip()
zzz = lambda : [int(i) for i in fast().split()]
(z, zz) = (input, lambda : list(map(int, z().split())))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from re import *
from sys import *
from math import *
from heapq import *
from queue import *
from bisect import *
from string import *
from itertools import *
from collections import *
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from collections import Counter as cc
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer):
	stdout.write(str(answer))
num = int(z())
arr = list(set(szzz()))
ans = 0
ans = 0
while arr:
	x = arr[0]
	lst = arr[1:]
	for i in arr[1:]:
		if i % x == 0:
			lst.remove(i)
	arr = lst
	ans += 1
print(ans)


n = int(input())
ar = list(map(int, input().split()))
ar = sorted(ar)
ans = 0
random = []
for i in range(0, len(ar)):
	x = ar[i]
	if x in random:
		continue
	random.append(x)
	for j in range(i + 1, len(ar)):
		if ar[j] % x == 0:
			random.append(ar[j])
	ans += 1
print(ans)


from copy import copy

def colors(m, n):
	m = int(m)
	n = n.split()
	n = [int(n[i]) for i in range(len(n))]
	if len(n) != m:
		return 'Incorrect input'
	t = []
	while m != 0:
		l = []
		s = []
		f = min(n)
		for i in n:
			if i % f == 0:
				s.append(i)
			else:
				l.append(i)
		t.append(s)
		n = l
		m -= len(s)
	return len(t)
print(colors(input().strip(), input().strip()))


def PaintTheNumbers(arr):
	arr = sorted(arr)
	groups = []
	while len(arr) != 0:
		group = [arr[0]]
		for i in range(1, len(arr)):
			if arr[i] % group[0] == 0:
				group.append(arr[i])
		groups.append(group)
		arr = [x for x in arr if x not in set(group)]
	return len(groups)
n = int(input())
arr = [int(x) for x in input().split()]
print(PaintTheNumbers(arr))


I = lambda : list(map(int, input().split()))
(n,) = I()
l = set(I())
l = list(l)
l.sort()
visi = []
ch = min(l)
c = 0
for i in range(len(l)):
	if l[i] not in visi:
		visi.append(l[i])
		c += 1
		for j in range(i + 1, len(l)):
			if l[j] % l[i] == 0:
				visi.append(l[j])
print(c)


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
k = 0
for i in range(n):
	if arr[i] <= 0:
		continue
	for j in range(i + 1, n):
		if arr[j] % arr[i] == 0:
			arr[j] = k
	arr[i] = k
	k -= 1
print(len(set(arr)))


n = int(input())
s = sorted(list(set(list(map(int, input().split())))))
k = 1
i = -1
ss = s * 1
m = len(s)
while True:
	i += 1
	z = ss[i]
	if s[i] != -1:
		for j in range(m):
			if s[j] % z == 0 and s[j] != -1:
				s.pop(j)
				s.insert(j, -1)
		if len(set(s)) != 1:
			k += 1
		else:
			break
print(k)


n = int(input())
a = list(map(int, input().split()))
c = 0
while len(a) > 0:
	c = c + 1
	m1 = min(a)
	m2 = max(a)
	d = m2 // m1
	a.remove(m1)
	i = 1
	while i < d + 1:
		if i * m1 in a:
			a.remove(i * m1)
			i = i - 1
		i = i + 1
print(c)


N = int(input())
arr = list(map(int, input().split()))
if N == 1:
	print(1)
else:
	arr.sort()
	covered = {}
	res = 0
	for i in range(0, N):
		num = arr[i]
		if num in covered:
			continue
		covered[num] = 1
		for j in range(1 + i, N):
			num2 = arr[j]
			if num2 not in covered and num2 % num == 0:
				covered[num2] = 1
		res += 1
	print(res)


from sys import stdin

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()
n = ii()
a = li()
a.sort()
p = 0
s = sum(a)
for i in range(n):
	x = a[i]
	if x:
		for j in range(i, n):
			if not a[j] % x:
				s -= a[j]
				a[j] = 0
		p += 1
	if not s:
		break
print(p)


n = int(input())
l = list(map(int, input().split(' ')))
count = 0
while len(l) != 0:
	mini = min(l)
	i = 0
	while i < len(l):
		if l[i] % mini == 0:
			l.pop(i)
		else:
			i += 1
	count += 1
print(count)


n = int(input())
a = list(map(int, input().split()))
a.sort()
b = []
c = 1
for i in range(0, n):
	b.append(0)
for i in range(0, n - 1):
	for j in range(i + 1, n):
		if a[j] % a[i] == 0 and b[j] == 0:
			b[j] = c
			b[i] = c
	c += 1
b.sort()
ans = 1
for i in range(1, n):
	if b[i] != b[i - 1]:
		ans += 1
	elif b[i] == 0:
		ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
x = 0
while len(a) >= 1:
	multiples_a0 = [n for n in a if n % a[0] == 0]
	a = [x for x in a if x not in multiples_a0]
	x += 1
print(x)


n = int(input())
a = list(map(int, input().split()))
a.sort()
l = len(a)
result = [[a[0]]]
j = 1
div = False
for i in range(1, l):
	for k in range(j):
		if a[i] % result[k][0] == 0:
			result[k].append(a[i])
			div = False
			break
		else:
			div = True
	if div:
		j += 1
		result.append([a[i]])
print(len(result))


n = int(input())
n -= 1
elem = list(map(int, input().split()))
elem.sort()
k = 0
while True:
	if len(elem) == 0:
		break
	k += 1
	elem = list(filter(lambda x: x % elem[0], elem))
print(k)


n = int(input())
a = list(map(int, input().split()))
a.sort()
i = 0
c = 0
while len(a) != 0:
	x = []
	x.append(a[i])
	for j in range(i + 1, len(a)):
		if a[j] % a[i] == 0:
			x.append(a[j])
	for j in x:
		a.remove(j)
	c += 1
print(c)


n = int(input())
a = [int(x) for x in input().split()]
INF = 101

def check():
	global a, INF
	for i in a:
		if i < INF:
			return True
	return False
cnt = 0
while check():
	mn = INF
	for i in a:
		mn = min(mn, i)
	for i in range(n):
		if a[i] % mn == 0:
			a[i] = INF
	cnt += 1
print(cnt)


import sys

class APaintTheNumbers:

	def solve(self):
		n = int(input())
		a = [int(_) for _ in input().split()]
		a.sort()
		ans = 0
		done = [0] * n
		for i in range(n):
			if done[i]:
				continue
			ans += 1
			for j in range(i, n):
				if done[j]:
					continue
				if a[j] % a[i] == 0:
					done[j] = 1
		print(ans)
solver = APaintTheNumbers()
input = sys.stdin.readline
solver.solve()


from sys import stdin
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [a[0]]
for i in a:
	for j in l:
		if i % j == 0:
			break
	else:
		l.append(i)
print(len(l))


import math
import sys
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def sieve(n):
	r = []
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	prime[0] = False
	prime[1] = False
	for p in range(n + 1):
		if prime[p]:
			r.append(p)
	return r
n = ii()
d = li()
d = sorted(d)
t = [0] * n
for i in range(n):
	for j in range(n):
		if d[j] % d[i] == 0 and t[j] == 0:
			t[j] = d[i]
print(len(set(t)))


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
c = 0
k = set()
while len(set(a)) != 1:
	for j in range(c + 1, n):
		if a[j] != 0 and a[c] != 0:
			if a[j] % a[c] == 0:
				a[j] = 0
	a[c] = 0
	k.add(len(set(a)))
	c += 1
if len(k) == 0:
	print(1)
else:
	print(len(k))


def painting(lst):
	result = list()
	for i in lst:
		for j in result:
			if i % j == 0:
				break
		else:
			result.append(i)
	return len(result)
m = int(input())
a = [int(x) for x in input().split()]
print(painting(sorted(a)))


n = int(input())
arr = map(int, input().split(' '))
arr = sorted(arr)
colors = []
for i in arr:
	isDivisible = False
	for color in colors:
		if i % color == 0:
			isDivisible = True
	if isDivisible == False:
		colors.append(i)
print(len(colors))


n = int(input())
y = list(map(int, input().split()))
y = sorted(y)
arr = [0] * n
i = 0
count = 1
while i < n:
	j = i + 1
	if arr[i] == 0:
		arr[i] = count
		while j < n:
			if y[j] % y[i] == 0 and arr[j] == 0:
				arr[j] = count
			j += 1
		count += 1
	i += 1
print(len(set(arr)))


import sys
import math
import bisect

def main():
	n = int(input())
	A = list(map(int, input().split()))
	A.sort()
	B = [1] * n
	for i in range(n):
		if B[i] == 1:
			for j in range(i + 1, n):
				if A[j] % A[i] == 0:
					B[j] = 0
	print(sum(B))
main()


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def solve():
	n = inp()
	a = inlt()
	a = sorted(a)
	min = []
	for i in a:
		div = False
		for j in min:
			if i % j == 0:
				div = True
				break
		if not div:
			min.append(i)
	print(len(min))
solve()


n = int(input())
l = list(map(int, input().split()))
l.sort()
arr = [[min(l)]]
ct = 0
while max(l) != 0:
	x = -1
	for i in l:
		if i > 0:
			x = i
			break
	if x != -1:
		ct += 1
		for i in range(len(l)):
			if l[i] > 0 and l[i] % x == 0:
				l[i] = 0
print(ct)


n = int(input())
a = list(map(int, input().split()))
a.sort()
i = 0
while i < n:
	j = i
	k = a[i]
	while j < n:
		if a[j] % k == 0:
			a[j] = a[i]
		j += 1
	i = i + 1
print(len(set(a)))


n = int(input())
L = list(map(int, input().split()))
u = 0
while L != []:
	L.sort()
	A = [0]
	for i in L:
		if i != L[0]:
			if i % L[0] == 0:
				A.append(i)
	A[0] = L[0]
	S = set(L)
	Y = set(A)
	S = S - Y
	L = list(S)
	u = u + 1
print(u)


n = int(input())
s = input()
b = s.split(' ')
a = []
for x in b:
	k = int(x)
	a.append(k)
a.sort(reverse=False)
dem = 0
num = 0
dau = []
for i in range(0, n + 1):
	dau.append(0)
i = 0
while dem < n:
	num = num + 1
	while dau[i] == 1 and i < n:
		i = i + 1
	for j in range(i, n):
		if a[j] % a[i] == 0 and dau[j] == 0:
			dem = dem + 1
			dau[j] = 1
print(num)


n = int(input())
arr = sorted(list(map(int, input().split())))
used = [0] * n
ans = 0
for i in range(n):
	if used[i] == 0:
		used[i] = 1
		ans += 1
		for j in range(i + 1, n):
			if arr[j] % arr[i] == 0:
				used[j] = 1
print(ans)


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
d = {}
for i in arr:
	d[i] = 0
for i in arr:
	if d[i] == 0:
		d[i] = i
		for j in range(i, arr[-1] + 1, i):
			try:
				d[j] = i
			except:
				pass
v = []
for i in d:
	v.append(d[i])
print(len(set(v)))


t = int(input())
List = list(map(int, input().split()))
List.sort()
count = 0
flag = 0
index = len(List) - 1
i = 0
j = 1
while True:
	if len(List) == 1:
		count += 1
		break
	if i >= len(List) - 1:
		break
	while True:
		if List[j] % List[i] == 0:
			del List[j]
		else:
			j += 1
		if j >= len(List):
			break
	del List[i]
	count += 1
	j = 1
print(count)


N = int(input())
nums = sorted([int(x) for x in input().split(' ')])
colored = [False] * N
count = 0
for i in range(N):
	if not colored[i]:
		count += 1
		colored[i] = True
		for j in range(i + 1, N):
			if not nums[j] % nums[i]:
				colored[j] = True
print(count)


n = int(input())
a = list(map(int, input().split()))
s = set()
b = sorted(a)
for i in a:
	for x in b:
		if i % x == 0:
			s.add(x)
			break
print(len(s))


n = int(input())
a = [int(i) for i in input().split()]
count = 0
while a:
	mn = min(a)
	for i in range(n):
		if a[i] % mn == 0:
			a[i] = 0
	a = [i for i in a if i != 0]
	n = len(a)
	count += 1
print(count)


import os
import sys
from io import BytesIO, IOBase

def solution(arr, n):
	colors = 0
	temp = arr[:]
	while temp:
		min_x = min(temp)
		colors += 1
		for x in arr:
			if x % min_x == 0 and x in temp:
				temp.remove(x)
	write(colors)

def main():
	n = r_int()
	arr = r_array()
	solution(arr, n)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def write(*args, end='\n'):
	for x in args:
		sys.stdout.write(str(x) + ' ')
	sys.stdout.write(end)

def r_array():
	return [int(x) for x in input().split()]

def r_int():
	return int(input())

def w_array(arr):
	for x in arr:
		write(x, end=' ')
	write()
main()


x = int(input())
a = list(map(int, input().split()))
c = 0
a.sort()
for i in range(x):
	if a[i] != -1:
		c += 1
		for j in range(i + 1, x):
			if a[j] % a[i] == 0:
				a[j] = -1
print(c)


n = int(input())
paint = list(map(int, input().split()))
paint = list(set(paint))
paint.sort()
i = 0
while i < len(paint):
	temp = paint[i]
	paint = [i for i in paint if i % temp != 0 or i == temp]
	i = i + 1
print(len(paint))


n = int(input())
l = list(map(int, input().split()))
l.sort()
d = set({})
d1 = set({})
r = 0
for i in range(len(l)):
	if l[i] in d1:
		continue
	d.add(l[i])
	for j in range(len(l)):
		if l[j] % l[i] == 0:
			d1.add(l[j])
print(len(d))


n = int(input())
l = list(map(int, input().split()))
m = min(l)
l2 = []
temp = []
while len(l) > 0:
	m = min(l)
	l2.append(m)
	for i in range(len(l)):
		if l[i] % m == 0:
			temp.append(l[i])
	for x in temp:
		l.remove(x)
	temp = []
print(len(l2))


n = int(input())
a = list(map(int, input().split()))
a.sort()
c = 0
for i in range(len(a)):
	if a[i] != 0:
		w = a[i]
		for j in range(i, len(a)):
			if a[j] > 0 and w > 0:
				if a[j] % w == 0:
					a[j] = 0
		c = c + 1
		q = list(set(a))
		if len(q) == 1 and q[0] == 0:
			break
print(c)


n = int(input())
b = [1] * n
a = [int(x) for x in input().split()]
a.sort()
count = 0
for i in range(len(a)):
	if b[i] == 1:
		count += 1
		for j in range(i, len(a)):
			if a[j] % a[i] == 0:
				b[j] = 0
print(count)


n = int(input())
a = [int(i) for i in str(input()).split()]
a.sort()
c = []
while len(a) > 0:
	s = set([a[0]])
	i = 1
	while i < len(a):
		if a[i] % a[0] == 0:
			s.add(a.pop(i))
		else:
			i = i + 1
	c.append(s)
	a.pop(0)
print(len(c))


n = int(input())
a = list(map(int, input().split()))
sorted_a = sorted(a)
count = 0
color = 0
for i in range(n):
	if sorted_a[i] == -1:
		continue
	color += 1
	for j in range(i + 1, n):
		if sorted_a[j] % sorted_a[i] == 0:
			sorted_a[j] = -1
			count += 1
		if count == n:
			break
	if count == n:
		break
print(color)


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
delims = [arr[0]]
for i in arr[1:]:
	fl = False
	for j in delims:
		if (i / j).is_integer():
			fl = True
	if not fl:
		delims.append(i)
print(len(delims))


def gcd(a, b):
	while a != 0 and b != 0:
		if a > b:
			return gcd(a % b, b)
		else:
			return gcd(b % a, a)
	return a + b
n = int(input())
b = [0] * n
ans = 0
b = [int(i) for i in input().split()]
b.sort()
for i in range(n):
	if b[i] != -1:
		for j in range(i + 1, n):
			if b[j] % b[i] == 0:
				b[j] = -1
for i in b:
	if i != -1:
		ans += 1
	if i == 1:
		ans = 1
		break
print(ans)


x = int(input())
ar = list(map(int, input().split()))[:x]
ar.sort()
b = [0] * x
for i in range(x):
	for j in range(i, x):
		if ar[j] % ar[i] == 0:
			b[j] = b[j] + 1
print(b.count(1))


n = int(input())
a = [int(i) for i in input().split()]
a = set(a)
a = list(a)
a.sort()
l = len(a)
s = 0
if a[0] == 1:
	print(1)
	exit(0)
for i in range(0, l - 1):
	if a[i] > 0:
		s += 1
		for j in range(i + 1, l):
			if a[j] % a[i] == 0:
				a[j] = 0
if a[l - 1] != 0:
	s += 1
print(s)


from sys import stdin
n = int(stdin.readline().strip())
s = list(map(int, stdin.readline().strip().split()))
ans = 0
s.sort()
while len(s) > 0:
	s1 = []
	arr = s[0]
	flag = False
	for i in range(len(s)):
		if s[i] % arr != 0:
			s1.append(s[i])
		else:
			flag = True
	s = s1.copy()
	if flag == True:
		ans += 1
print(ans)


n = int(input())
array = list(map(int, input().split()))
array.sort()
c = 0
while len(array) > 0:
	c += 1
	array = [u for u in array if u % array[0] != 0]
print(c)


n = int(input())
arr = list(map(int, input().split()))
arr = sorted(arr)
ans = [arr[0]]
for i in range(1, len(arr)):
	k = 0
	for el in ans:
		if arr[i] % el == 0:
			k = 1
			break
	if k == 0:
		ans.append(arr[i])
print(len(ans))


n = int(input())
a = list(map(int, input().split()))
a.sort()
count = 0
for i in range(n - 1):
	for j in range(i + 1, n):
		if a[i] > 0 and a[j] % a[i] == 0:
			a[j] = -1
a.sort(reverse=True)
count = 0
for i in a:
	if i < 0:
		break
	else:
		count += 1
print(count)


q = input()
a = list(map(int, input().split()))
y = a
i = 0
while i <= len(a):
	b = list(filter(lambda x: x % min(y) == 0, y))
	c = list(filter(lambda x: x % min(y) != 0, y))
	i += 1
	y = c
	if c == []:
		break
print(i)


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	colors = [0] * n
	arr.sort()
	color = 1
	for i in range(n):
		if colors[i] == 0:
			colors[i] = color
			for j in range(i + 1, n):
				if arr[j] % arr[i] == 0 and colors[j] == 0:
					colors[j] = color
			color += 1
	print(max(colors))
main()


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
cnt = 0
while a:
	f = a.pop()
	rm = []
	for x in a:
		if x % f == 0:
			rm.append(x)
	for x in rm:
		a.remove(x)
	cnt += 1
print(cnt)


input()
l = set(map(int, input().split()))
count = 0
while len(l) > 0:
	m = min(l)
	l = [x for x in l if x % m]
	count += 1
print(count)


n = int(input())
a = sorted(list(map(int, input().split())))
s = []
for q in a:
	for q1 in s:
		if q % q1 == 0:
			break
	else:
		s.append(q)
print(len(s))


__author__ = 'Esfandiar'
import sys
from collections import defaultdict
input = sys.stdin.readline
n = int(input())
a = sorted(list(map(int, input().split())))
res = 0
color = [0] * n
for i in range(n):
	if color[i] == 0:
		res += 1
		for j in range(i + 1, n):
			if a[j] % a[i] == 0:
				color[j] = 1
print(res)


N = int(input())
A = [int(i) for i in input().split()]
A = sorted(A)
count = 0
while A:
	count += 1
	(g, a) = (A[0], [])
	for i in A:
		if i % g != 0:
			a.append(i)
	A = a
print(count)


n = int(input())
s = [int(i) for i in input().split()]
s.sort()
(d, r) = ([], [])
c = 0
for i in range(n):
	if s[i] != 0:
		for j in range(i + 1, n):
			if s[j] != 0:
				if s[j] % s[i] == 0:
					s[j] = 0
s = [i for i in s if i != 0]
print(len(s))


number = input()
x = [int(i) for i in input().split()]
used = []
x.sort()
colors = 0
for n in x:
	if n in used:
		pass
	else:
		colors += 1
		for j in x:
			if j % n == 0:
				used.append(j)
print(colors)


i = input
i()
a = {*map(int, i().split())}
print(sum((all((x % y for y in a - {x})) for x in a)))


i = input()
nums = input().split(' ')
for i in range(len(nums)):
	nums[i] = int(nums[i])
nums.sort()
color = 0
while len(nums) > 0:
	num1 = nums.pop(0)
	color += 1
	for i in range(len(nums) - 1, -1, -1):
		if nums[i] % num1 == 0:
			nums.remove(nums[i])
print(str(color))


n = int(input())
arr = list(map(int, input().split()))
count = 0
x = min(arr)
while x != 999:
	count += 1
	for i in range(len(arr)):
		if arr[i] != 999 and arr[i] % x == 0:
			arr[i] = 999
	x = min(arr)
print(count)


x = input()
y = input()
z = y.split()
w = [int(d) for d in z]
w.sort()
p = 0
t = []
for i in range(len(w)):
	for j in range(i + 1, len(w)):
		if w[i] != 0 and w[j] % w[i] == 0:
			w[j] = 0
		else:
			continue
for num in w:
	if num == 0:
		continue
	else:
		p = p + 1
print(p)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
cnt = 0
while len(a) != 0:
	j = 1
	while j < len(a):
		if a[j] % a[0] == 0:
			del a[j]
		else:
			j += 1
	del a[0]
	cnt += 1
print(cnt)


n = int(input())
arr = [int(i) for i in input().split()]
temp = list(set(arr))
lnth = len(set(arr))
cnt = lnth
for i in range(lnth):
	for j in range(lnth):
		if temp[i] != 0 and temp[j] % temp[i] == 0 and (temp[i] < temp[j]):
			cnt = cnt - 1
			temp[j] = 0
print(cnt)


def calc(X):
	if len(X) == 0:
		return 0
	return calc([x for x in X if x % min(X)]) + 1
N = int(input())
print(calc([int(a) for a in input().split()]))


a = int(input())
A = list(map(int, input().split()))
A.sort()
B = []
for i in range(a):
	j = 0
	q = True
	while q == True and j < len(B):
		if A[i] % B[j] == 0:
			q = False
		else:
			j += 1
	if q == True:
		B.append(A[i])
print(len(B))


n = int(input())
a = list(map(int, input().split()))
a.sort()
cnt = 0
for i in a:
	if i == -1:
		continue
	else:
		cnt += 1
		temp = i
	for j in a:
		if j % temp == 0:
			ind = a.index(j)
			a[ind] = -1
print(cnt)


from sys import stdin

def main():
	input = lambda : stdin.readline()[:-1]
	N = int(input())
	A = list(map(int, input().split()))
	A.sort()
	for i in range(N - 1):
		for j in range(i + 1, N):
			if not A[j] % A[i]:
				A[j] = float('inf')
	ans = 0
	for i in A:
		if not i % 1:
			ans += 1
	print(ans)
main()


n = int(input())
l = list(map(int, input().split()))
c = 1
count = 0
while c:
	count += 1
	m = min(l)
	if m == 101:
		c = 0
		break
	for i in range(n):
		if l[i] % m == 0:
			l[i] = 101
print(count - 1)


n = int(input())
x = sorted(list(map(int, input().split(' '))), reverse=True)
count = 0
while len(x) != 0:
	Min = x.pop()
	x = [i for i in x if i % Min != 0]
	count += 1
print(count)


n = int(input())
A = list(map(int, input().split()))
A = sorted(list(set(A)))
colors = []
for a in A:
	if not a in colors:
		for i in range(len(colors)):
			if a % colors[i] == 0:
				break
		else:
			colors.append(a)
print(len(colors))


def smallestfactor(n):
	for i in range(2, n + 1):
		if n % i == 0:
			return i
n = int(input())
numbers = sorted([int(k) for k in input().split(' ')])
colors = 0
while len(numbers) != 0:
	colors += 1
	if numbers[0] == 1:
		numbers = []
	else:
		fact = numbers[0]
		numbers = [k for k in numbers if k % fact != 0]
print(colors)


n = int(input())
l = []
q = []
w = []
S = 0
D = 0
p = input().rstrip().split(' ')
p.sort(key=int)
for i in range(0, len(p)):
	if 1:
		if len(l) == 0:
			D += 1
			l.append(int(p[i]))
		else:
			for j in range(0, len(l)):
				if int(p[i]) % l[j] == 0:
					break
			else:
				D += 1
				l.append(int(p[i]))
print(D)


num = int(input())
a = list(map(int, input().split()))
count = 0
a.sort()
for i in range(num):
	if a[i] != 0:
		for j in range(i + 1, num):
			if not a[j] % a[i]:
				a[j] = 0
for k in range(num):
	if a[k] != 0:
		count += 1
print(count)


n = int(input())
res = 0
if n != 0:
	nums = list(map(int, input().split()))
	nums.sort(reverse=True)
	while nums:
		div = nums.pop()
		to_delete = []
		for i in range(len(nums)):
			if nums[i] % div == 0:
				to_delete.append(i)
		for ind in reversed(to_delete):
			nums.pop(ind)
		res += 1
print(res)


n = int(input())
R = list(map(int, input().split()))
T = 0
while R != []:
	R.sort()
	D = [0]
	for i in R:
		if i != R[0]:
			if i % R[0] == 0:
				D.append(i)
	D[0] = R[0]
	Q = set(R)
	S = set(D)
	Q = Q - S
	R = list(Q)
	T = T + 1
print(T)


n = int(input())
A = list(map(int, input().split()))
A.sort()
S = set()
S.add(A[0])
for i in range(1, n):
	flag = True
	for s in S:
		if A[i] % s == 0:
			flag = False
			break
	if flag:
		S.add(A[i])
print(len(S))


n = int(input())
l1 = list(map(int, input().split()))
l1.sort()
cnt = 0
while l1:
	x = l1[0]
	nw = []
	for i in range(1, len(l1)):
		if l1[i] % x != 0:
			nw.append(l1[i])
	l1 = nw
	cnt += 1
print(cnt)


n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
while a:
	m = a[0]
	b = []
	for x in a[1:]:
		if x % m != 0:
			b.append(x)
	a = b
	ans += 1
print(ans)


(n, colors, cnt) = (int(input()), [int(x) for x in input().split()], 0)
while len(colors) > 0:
	mini = min(colors)
	colors = [int(x) for x in colors if x % mini != 0]
	cnt += 1
print(cnt)


def painting(arr):
	arr.sort()
	ans = 0
	while arr:
		x = arr.pop(0)
		ans += 1
		j = rem_nums(x, arr)
		for i in j:
			arr.remove(i)
	return ans

def rem_nums(x, arr):
	ans = []
	for i in arr:
		if i % x == 0:
			ans.append(i)
	return ans
n = int(input())
arr = list(map(int, input().split()))
print(painting(arr))


def ans(k, m):
	k = [elem for elem in k if elem % m != 0]
	return k
count = 0
t = int(input())
list1 = list(map(int, input().split()))
m = min(list1)
while len(list1) != 0:
	m = min(list1)
	list1 = ans(list1, m)
	count += 1
print(count)


color = []
n = int(input())
num = [int(i) for i in input().split()]
num.sort()
aria = [-1 for i in range(n)]
cnt = 0
for i in range(n):
	ans = 0
	for j in range(i):
		if num[i] % num[j] == 0:
			ans = 1
	if ans == 0:
		cnt += 1
print(cnt)


n = int(input())
a = sorted(list(map(int, input().split())))

def name(num):
	for i in range(len(a)):
		if a[i] % num == 0:
			a[i] = 0
count = 0
for num in a:
	if num != 0:
		name(num)
		count += 1
print(count)


n = int(input())
arr = list(map(int, input().split()))
answ = 0
while arr:
	min_elem = min(arr)
	i = 0
	answ += 1
	while i < len(arr):
		if arr[i] % min_elem == 0:
			del arr[i]
		else:
			i += 1
print(answ)


n = int(input())
a = list(map(int, input().strip().split(' ')))
a.sort()
p = [a[0]]
c = 1
for i in range(1, n):
	k = 1
	for j in p:
		if a[i] % j == 0:
			k = 0
	if k:
		p.append(a[i])
		c += 1
print(c)


n = int(input())
array = [int(_) for _ in input().split()]
counter = 0
while array:
	m = min(array)
	for element in array:
		if element % m == 0:
			array = [x for x in array if x != element]
	counter += 1
print(counter)


a = int(input())
l = [int(i) for i in input().split()]
l.sort()
colored = list()
if l[0] == 1:
	print(1)
	exit()
for i in range(a):
	boo = False
	for j in colored:
		if l[i] % j == 0:
			boo = True
			break
	if boo == False:
		colored.append(l[i])
print(len(colored))


n = int(input())
a = list(sorted(map(int, input().split())))
counter = 0
while len(a) != 0:
	tmp = a[0]
	b = []
	for i in range(1, len(a)):
		if a[i] % tmp != 0:
			b.append(a[i])
	a = b
	counter += 1
print(counter)


input()
a = set(map(int, input().split()))
r = 0
while a:
	r += 1
	a -= set(range(0, 101, min(a)))
print(r)


n = int(input())
A = [int(i) for i in input().split()]
A.sort()
ans = 1
Ans = [A[0]]
for i in range(1, n):
	chk = False
	for a in Ans:
		if A[i] % a == 0:
			chk = True
			break
	if chk == False:
		ans += 1
		Ans.append(A[i])
print(ans)


n = int(input())
a = sorted(map(int, input().split()))
z = 0
for j in range(len(a)):
	if a[j] > 0:
		z += 1
		for i in range(j + 1, len(a)):
			if a[i] % a[j] == 0:
				a[i] = 0
print(z)


import sys

def read():
	return sys.stdin.readline()

def main():
	n = int(read())
	a = list(map(int, read().split()))
	a.sort()
	k = 0
	used = [0] * n
	for i in range(n):
		if used[i]:
			continue
		k += 1
		for j in range(i, n):
			if a[j] % a[i] == 0:
				used[j] = True
	print(k)
main()


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
for i in range(0, n):
	if a[i] != -1:
		for j in range(i + 1, n):
			if a[j] % a[i] == 0 and a[j] != -1:
				a[j] = -1
		a[i] = 0
counter = a.count(0)
print(counter)


n = int(input())
a = list(map(int, input().split()))
a.sort()
x = []
for i in range(0, n):
	y = 1
	if a[i] != 0:
		for j in range(0, n):
			if i != j and a[i] != 0 and (a[j] != 0) and (a[j] % a[i] == 0):
				a[j] = 0
				y = y + 1
			else:
				continue
		x.append(y)
	else:
		continue
print(len(x))


N = int(input())
X = sorted(list(map(int, input().split())))
(Check, i, Count) = ([False for i in range(N)], 0, 0)
while i < N:
	if not Check[i]:
		Count += 1
		j = i
		while j < N:
			if X[j] % X[i] == 0:
				Check[j] = True
			j += 1
	i += 1
print(Count)


n = int(input())
a = set(map(int, input().split()))
a = list(a)
a.sort()
res = set()
count = 0
for x in a:
	for y in res:
		if x % y == 0:
			break
	else:
		count += 1
		res.add(x)
print(count)


def solution(l1, n):
	i = 0
	ans = 0
	while l1:
		targ = min(l1)
		l1 = [x for x in l1 if x % targ]
		ans += 1
	return ans

def answer():
	n = int(input())
	l1 = [int(x) for x in input().split()]
	print(solution(l1, n))
answer()


elem = int(input())
ar = []
for t in input().split(' '):
	ar.append(int(t))
ar.sort()
count = 0
div = []
for x in ar:
	ch = 0
	for y in div:
		if x % y == 0:
			ch = ch + 1
			break
	if ch == 0:
		div.append(x)
		count = count + 1
print(count)


n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
e = set()
c = []
for x in b:
	if x not in c:
		c.append(x)
for i in range(len(c)):
	for j in range(i + 1, len(c)):
		if c[j] % c[i] == 0:
			e.add(c[j])
for i in list(e):
	c.remove(i)
print(len(c))


n = int(input())
a = []
inp = input().split()
for i in inp:
	a.append(int(i))
a.sort()
color = 0
while len(a) > 0:
	small = a[0]
	indices = []
	for i in range(len(a)):
		if a[i] % small == 0:
			indices.append(a[i])
	for i in indices:
		a.remove(i)
	color += 1
print(color)


n = int(input())
l = list(map(int, input().split()))
l.sort()
count = 0
for i in range(n):
	uniq = True
	for j in range(i):
		if l[i] % l[j] == 0:
			uniq = False
			break
	count += uniq
print(count)


import sys
input = lambda : sys.stdin.readline().strip()
n = int(input())
ls = list(set(map(int, input().split())))
ls.sort()
d = {}
for i in range(len(ls)):
	for j in range(i, len(ls)):
		if ls[j] % ls[i] == 0:
			try:
				d[ls[j]] += 0
			except:
				d[ls[j]] = ls[i]
print(len(set(d.values())))


from sys import stdin, stdout
n = int(stdin.readline())
l = [int(x) for x in stdin.readline().split()]
l.sort()
cnt = 0
for i in range(0, n):
	if l[i] != 0:
		cnt += 1
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				l[j] = 0
stdout.write(str(cnt))


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
count = 0
if 0 in a:
	a = [m for m in a if m != 0]
	count += 1
while len(a) > 0:
	x = a[0]
	for y in a[1:]:
		if y % x == 0:
			a.remove(y)
	a.remove(x)
	count += 1
print(count)


n = int(input())
s = list(map(int, input().split()))
ss = list(s)
r = []
rr = []
t = 0
while len(ss) != 0:
	m = min(ss)
	ss = [x for x in ss if x != m and x % m != 0]
	t += 1
print(t)


n = int(input())
s = [int(i) for i in input().split()]
cnt = 0
s = sorted(set(s))
while len(s) != 0:
	s1 = s[0]
	s = s[1:]
	s = [int(i) for i in s if i % s1 != 0]
	cnt += 1
print(cnt)


import sys
import math
CASE = 0
rla = ''

def solve():
	n = int(rla)
	li = [int(i) for i in input().split()]
	li.sort()
	ans = 0
	for i in range(len(li)):
		if li[i] == 0:
			continue
		ans += 1
		for j in range(i + 1, len(li)):
			if li[j] == 0:
				continue
			if li[j] % li[i] == 0:
				li[j] = 0
		li[i] = 0
	print(ans)
while True:
	rla = sys.stdin.readline()
	cases = 1
	if not rla:
		break
	if (rla == '\n') | (rla == ''):
		continue
	if CASE == 1:
		cases = int(rla)
	for cas in range(cases):
		solve()


q = int(input())
s = sorted(list(map(int, input().split())))
ss = set()
for i in s:
	f = True
	for j in ss:
		if i % j == 0:
			f = False
			break
	if f:
		ss.add(i)
print(len(ss))


a = int(input())
inps = [int(a) for a in input().split()][:a]
(mat, ans) = ([], [])
ctr = 0
non = 0
inps.sort()
ans = inps
ans2 = [abc for abc in ans]
while len(ans) > 0:
	x = ans[0]
	for i in range(len(ans2)):
		if ans2[i] % x == 0:
			try:
				ans.remove(ans2[i])
			except:
				non += 1
	ctr += 1
print(ctr)


import sys
input = lambda : sys.stdin.readline().strip()
n = int(input())
a = sorted(map(int, input().split()))
colors = 0
while a:
	colors += 1
	a = [v for v in a if v % a[0] != 0]
print(colors)


_ = input()
arr = list(map(int, input().split()))
arr.sort()
colors = {}
colors[0] = arr[0]
for i in range(len(arr)):
	c = 0
	while c <= len(colors):
		if c != len(colors) and arr[i] % colors[c] == 0:
			break
		if c == len(colors):
			colors[c] = arr[i]
			break
		c += 1
print(len(colors))


n = int(input())
array = sorted(map(int, input().split()))
array_index = list(range(len(array)))
total = 0
for j in range(len(array)):
	for i in range(j + 1, len(array)):
		if array[i] % array[j] == 0:
			if array_index[i] != -1:
				array_index[i] = -1
for k in array_index:
	if k != -1:
		total += 1
print(total)


n = int(input())
l = [int(y) for y in input().split()]
if 1 in l:
	print(1)
else:
	a = set(l)
	l = list(a)
	l.sort()
	p = []
	for i in range(len(l)):
		x = []
		for j in range(i + 1, len(l)):
			if l[j] != 0 and l[i] != 0 and (l[j] % l[i] == 0):
				x.append(l[j])
				l[j] = 0
		if len(x) != 0:
			p.append(x)
	c = 0
	for i in l:
		if i != 0:
			c += 1
	print(c)


x = input()
l = list(map(int, input().split()))
a = 0
n = len(l)
for i in range(n):
	if l[i] != 0:
		for j in range(n):
			if j != i and l[i] != 0 and (l[j] != 0) and (l[i] % l[j] == 0):
				l[i] = 0
				a += 1
print(n - a)


import sys

def getAndParseInt(num=1):
	string = sys.stdin.readline().strip()
	if num == 1:
		return int(string)
	else:
		return [int(part) for part in string.split()]

def getAndParseString(num=1, delim=''):
	string = sys.stdin.readline().strip()
	if num == 1:
		return string
	elif delim != '':
		return [part for part in string.split(delim)]
	else:
		return [part for part in string.split()]
n = getAndParseInt()
arr = getAndParseInt(2)
arr = list(set(arr))
n = len(arr)
arr.sort()
color_count = 1
colors = [1]
for i in range(1, n):
	for j in range(0, i):
		if arr[i] % arr[j] == 0:
			colors.append(colors[j])
			break
	else:
		color_count += 1
		colors.append(color_count)
print(color_count)


def partition(arr, low, high):
	i = low - 1
	pivot = arr[high]
	for j in range(low, high):
		if arr[j] <= pivot:
			i = i + 1
			(arr[i], arr[j]) = (arr[j], arr[i])
	(arr[i + 1], arr[high]) = (arr[high], arr[i + 1])
	return i + 1

def quicksort(arr, low, high):
	if low == high:
		return arr[low]
	if low < high:
		partpoint = partition(arr, low, high)
		quicksort(arr, low, partpoint - 1)
		quicksort(arr, partpoint + 1, high)
n = int(input())
arr = list(map(int, input().split()))
quicksort(arr, 0, n - 1)
unique = 0
for i in range(n):
	if arr[i] != 0:
		unique = unique + 1
		ele = arr[i]
		for j in range(i, n):
			if arr[j] % ele == 0:
				arr[j] = 0
print(unique)


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
b = []
c = 1
b.append(a[0])
for i in range(1, n):
	if a[i] != a[i - 1]:
		f = 0
		for j in b:
			if a[i] % j == 0:
				f = 1
				break
		if f == 0:
			c += 1
			b.append(a[i])
print(c)


n = int(input())
a = list(set(map(int, input().split())))
a.sort()
n = len(a)
v = [0] * n
ans = 0
for i in range(n):
	if v[i] == 0:
		for j in range(i, n):
			if v[j] == 0 and a[j] % a[i] == 0:
				v[j] = 1
		ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
color = 0
while a.count(0) != n:
	d = 0
	flag = True
	color += 1
	for i in range(n):
		if a[i] != 0 and flag:
			d = a[i]
			a[i] = 0
			flag = False
			continue
		if d != 0:
			if a[i] % d == 0:
				a[i] = 0
print(color)


n = int(input())
a = list(map(int, input().split()))
if 1 in a:
	print(1)
else:
	a.sort()
	colors = [0 for i in range(n)]
	k = 1
	for i in range(len(a)):
		if colors[i] == 0:
			colors[i] = k
			k += 1
			for j in range(i + 1, len(a)):
				if a[j] % a[i] == 0:
					colors[j] = colors[i]
	print(k - 1)


n = int(input())
a = sorted(list(map(int, input().split())))
c = 0
for i in range(n):
	if a[i] == 0:
		continue
	for j in range(i + 1, n):
		if a[j] != 0 and a[i] != 0 and (a[j] % a[i] == 0):
			a[j] = 0
	a[i] = 0
	c += 1
	if a.count(0) == n:
		break
print(c)


n = int(input())
nums = [int(x) for x in input().split()]
lowest = 0
count = 0
q = []
while nums:
	lowest = min(nums)
	for i in list(nums):
		if i % lowest == 0:
			count += 1
			nums.remove(i)
	q.append(count)
	count = 0
print(len(q))


import sys
from collections import defaultdict as dd
mod = 10 ** 9 + 7

def ri(flag=0):
	if flag == 0:
		return [int(i) for i in sys.stdin.readline().split()]
	else:
		return int(sys.stdin.readline())
n = ri(1)
a = ri()
b = sorted(a)
c = dd(int)
ans = 0
val = 0
for i in range(n):
	if c[b[i]] == 0:
		val += 1
		for j in range(n):
			if b[j] % b[i] == 0:
				c[b[j]] = val
for i in c:
	ans = max(ans, c[i])
print(ans)


n = int(input())
a = sorted(map(int, input().split()))
r = 0
while a:
	r += 1
	a = [v for v in a if v % a[0] != 0]
print(r)


t = int(input())
arr = list(set(map(int, input().split())))
arr.sort()
d = dict()
d[min(arr)] = 1
for i in arr:
	d[i] = 0
for i in arr:
	for j in arr:
		if i % j == 0:
			d[i] += 1
count = 0
for i in d:
	if d[i] == 1:
		count += 1
print(count)


num = int(input())
nums = [int(x) for x in input().split(' ')]
sort = sorted(list(set(nums)))
used = []
counter = 0
bool = False
for elem in sort:
	for e in used:
		if elem % e == 0:
			bool = True
	if bool == False:
		nums = list(filter(lambda x: x % elem != 0, nums))
		counter += 1
		used.append(elem)
		if not nums:
			break
	bool = False
print(counter)


n = int(input())
line = input()
vis = [0 for _ in range(101)]
for i in line.split(' '):
	j = int(i)
	vis[j] = 1
ans = 0
for i in range(1, 101):
	if vis[i]:
		ans += 1
		j = i
		while j <= 100:
			vis[j] = 0
			j += i
print(ans)


n = int(input())
x = list(map(int, input().split()))
x = sorted(x)
count = 0
if len(x) == 1:
	print(1)
else:
	while len(x) > 1:
		temp = x[0]
		i = 0
		while i < len(x):
			if x[i] % temp == 0:
				del x[i]
			else:
				i += 1
		count += 1
	if len(x) == 1:
		print(count + 1)
	else:
		print(count)


import sys, itertools, math

def ia():
	return [int(i) for i in sys.stdin.readline().strip().split(' ')]

def ii():
	return int(sys.stdin.readline().strip())
ii()
N = sorted(ia())
ans = 0
for i in range(len(N)):
	if N[i] > 0:
		ans += 1
		for j in range(i + 1, len(N)):
			if N[j] > 0 and N[j] % N[i] == 0:
				N[j] = -1
print(ans)


n = int(input())
a = input()
b = a.split(' ')
for i in range(0, n):
	b[i] = int(b[i])
b.sort()
flag = 1
flag2 = 0
f1 = 0
res = 0
while flag > 0:
	flag = 0
	f1 = 0
	for i in range(0, n):
		if b[i] != -1:
			flag += 1
		if b[i] != -1 and f1 == 0:
			f1 += 1
			flag2 = b[i]
			res += 1
			b[i] = -1
		if b[i] % flag2 == 0 and f1 == 1 and (b[i] != -1):
			b[i] = -1
print(res)


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
count = 0
for i in range(n):
	cur_c = a[i]
	if not cur_c:
		continue
	count += 1
	for j in range(i + 1, n):
		if a[j] % cur_c == 0:
			a[j] = 0
print(count)


from sys import setcheckinterval, stdin
setcheckinterval(1000)
iin = lambda : int(stdin.readline())
lin = lambda : list(map(int, stdin.readline().split()))
n = iin()
a = lin()
a.sort()
sa = [a[0]]
for i in range(1, n):
	ch = 0
	x = a[i]
	for j in sa:
		if x % j == 0:
			ch = max(ch, j)
	if ch == 0:
		sa.append(x)
print(len(sa))


def main():
	(n, r) = (int(input()), 0)
	l = sorted(map(int, input().split()), reverse=True)
	while l:
		a = l.pop()
		l = [x for x in l if x % a]
		r += 1
	print(r)
main()


n = int(input())
a = sorted(list(map(int, input().split())))
canDiv = []
for i in a:
	if len(canDiv) == 0:
		canDiv.append(i)
	else:
		ok = False
		for j in canDiv:
			if i % j == 0:
				ok = True
		if not ok:
			canDiv.append(i)
print(len(canDiv))


n = int(input())
list1 = []
count = 0
ele = input()
for field in ele.split():
	list1.append(int(field))
list1.sort()
while len(list1) != 0:
	count += 1
	k = 0
	temp = list1[0]
	while True:
		if k == len(list1):
			break
		if int(list1[k]) % int(temp) == 0:
			list1.remove(list1[k])
			n = n - 1
			k = k - 1
		k += 1
print(count)


n = int(input())
s = [int(e) for e in input().split()]
k = min(s)
j = 0
c = 0
for i in range(n):
	if len(s) == 0:
		break
	c += 1
	while j < len(s):
		if s[j] % k == 0:
			s.remove(s[j])
		else:
			j += 1
	j = 0
	if len(s) != 0:
		k = min(s)
print(c)


n = int(input())
lst = input().split()
for i in range(n):
	lst[i] = int(lst[i])
lst.sort()

def func(x, y):
	global a
	a = []
	for i in range(y + 1, len(x)):
		if x[i] % x[y] == 0:
			a.append(i)
	for j in range(len(a)):
		x.pop(a[j] - j)
	return
k = 0
while k < len(lst):
	func(lst, k)
	k += 1
print(k)


def paint_numbers(numbers):
	ns = list(sorted(numbers))
	nc = [-1] * len(ns)
	colors = 0
	for i in range(len(ns)):
		if all(map(lambda c: c != -1, nc)):
			break
		if nc[i] > -1:
			continue
		colors += 1
		for j in range(len(nc)):
			if nc[j] > -1:
				continue
			if ns[j] % ns[i] == 0:
				nc[j] = colors
	return colors
n = int(input())
print(paint_numbers(map(int, input().rstrip().split())))


import sys
n = int(sys.stdin.readline())
arr = list(map(int, sys.stdin.readline().split()))
if 1 in arr:
	print(1)
else:
	arr.sort()
	visited = [False for i in range(n)]
	count = 0
	for i in range(n):
		if visited[i] == False:
			visited[i] = True
			cur = arr[i]
			count += 1
			for j in range(i + 1, n):
				if visited[j] == False and arr[j] % cur == 0:
					visited[j] = True
	print(count)


import array
number = int(input())
oarr = [int(x) for x in input().split()]
oarr.sort()
lastin = 0
l = len(oarr)
arr = [oarr[0]]
for i in range(1, l):
	if oarr[i] != oarr[i - 1]:
		arr.append(oarr[i])
l = len(arr)
minus = 0
for d in range(0, l):
	d = d - minus
	for m in range(0, l - minus):
		if arr[d] % arr[m] == 0 and d != m:
			change = 0
			arr.pop(d)
			minus += 1
			break
print(len(arr))


from sys import stdin, stdout
import heapq
import cProfile, math
from collections import Counter, defaultdict, deque
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
import sys, threading
import operator as op
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 6)
threading.stack_size(2 ** 27)
fac_warm_up = False
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n
		self.lista = [[_] for _ in range(n)]

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		if self.size[a] < self.size[b]:
			(a, b) = (b, a)
		self.num_sets -= 1
		self.parent[b] = a
		self.size[a] += self.size[b]
		self.lista[a] += self.lista[b]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def prime_factors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def all_factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def fibonacci_modP(n, MOD):
	if n < 2:
		return 1
	return (cached_fn(fibonacci_modP, (n + 1) // 2, MOD) * cached_fn(fibonacci_modP, n // 2, MOD) + cached_fn(fibonacci_modP, (n - 1) // 2, MOD) * cached_fn(fibonacci_modP, (n - 2) // 2, MOD)) % MOD

def factorial_modP_Wilson(n, p):
	if p <= n:
		return 0
	res = p - 1
	for i in range(n + 1, p):
		res = res * cached_fn(InverseEuler, i, p) % p
	return res

def binary(n, digits=20):
	b = bin(n)[2:]
	b = '0' * (digits - len(b)) + b
	return b

def is_prime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def generate_primes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p]:
			for i in range(p * 2, n + 1, p):
				prime[i] = False
		p += 1
	return prime
factorial_modP = []

def warm_up_fac(MOD):
	global factorial_modP, fac_warm_up
	if fac_warm_up:
		return
	factorial_modP = [1 for _ in range(fac_warm_up_size + 1)]
	for i in range(2, fac_warm_up_size):
		factorial_modP[i] = factorial_modP[i - 1] * i % MOD
	fac_warm_up = True

def InverseEuler(n, MOD):
	return pow(n, MOD - 2, MOD)

def nCr(n, r, MOD):
	global fac_warm_up, factorial_modP
	if not fac_warm_up:
		warm_up_fac(MOD)
		fac_warm_up = True
	return factorial_modP[n] * (pow(factorial_modP[r], MOD - 2, MOD) * pow(factorial_modP[n - r], MOD - 2, MOD) % MOD) % MOD

def test_print(*args):
	if testingMode:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def display_2D_list(li):
	for i in li:
		print(i)

def prefix_sum(li):
	sm = 0
	res = []
	for i in li:
		sm += i
		res.append(sm)
	return res

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result

def ncr(n, r):
	return math.factorial(n) / (math.factorial(n - r) * math.factorial(r))

def binary_search(i, li):
	fn = lambda x: li[x] - x // i
	x = -1
	b = len(li)
	while b >= 1:
		while b + x < len(li) and fn(b + x) > 0:
			x += b
		b = b // 2
	return x
TestCases = False
fac_warm_up_size = 10 ** 5 + 100
optimise_for_recursion = False

def main():
	n = get_int()
	li = list(set(get_list()))
	li.sort()
	st = set(li)
	res = 0
	for i in li:
		if i in st:
			res += 1
			k = set()
			for j in st:
				if j % i == 0:
					k.add(j)
			st = st - k
	print(res)
if TestCases:
	for i in range(get_int()):
		main()
else:
	main() if not optimise_for_recursion else threading.Thread(target=main).start()


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
visit = []
for i in range(n):
	visit.append(False)
count = 0
for i in range(n):
	if not visit[i]:
		count += 1
		for j in range(i + 1, n):
			if a[j] % a[i] == 0:
				visit[j] = True
print(count)


mod = 10 ** 9 + 7
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq
from random import randint as rn

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return map(int, input().split())

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def main():
	n = inin()
	l = ain()
	l.sort()
	a = []
	for i in range(101):
		a.append(0)
	ans = 0
	for i in l:
		if a[i] >= 1:
			continue
		ans += 1
		for j in range(i, 101, i):
			a[j] += 1
	print(ans)
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


N = int(input())
a = list(map(int, input().split()))
a = sorted(a)
sum = 0
i = j = 0
while i < len(a):
	sum += 1
	k = a[i]
	j = 0
	while j < len(a):
		if a[j] % k == 0:
			a.pop(j)
		else:
			j += 1
print(sum)


def GCD(x, y):
	if x > y:
		small = y
	else:
		small = x
	for i in range(1, small + 1):
		if x % i == 0 and y % i == 0:
			gcd = i
	return gcd
n = int(input())
l = list(map(int, input().split()))
l = list(set(l))
l.sort()
n = len(l)
s = set()
s.add(l[0])
for i in range(1, n):
	ser = list(s)
	c = 0
	for j in ser:
		if GCD(l[i], j) == j:
			c = 1
			break
	if c == 0:
		s.add(l[i])
print(len(s))


n = int(input())
A = list(map(int, input().split()))
B = set(A)
C = list(B)
D = sorted(C)
m = len(D)
for x in range(m - 1):
	for y in range(x + 1, m):
		if D[x] != 0:
			if D[y] % D[x] == 0:
				D[y] = 0
E = set(D)
if 0 in D:
	print(len(E) - 1)
else:
	print(len(E))


from collections import defaultdict, deque
from heapq import heappush, heappop
import sys
import math
import bisect

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return [list(x) for x in sys.stdin.readline().split()]

def S():
	res = list(sys.stdin.readline())
	if res[-1] == '\n':
		return res[:-1]
	return res

def IR(n):
	return [I() for i in range(n)]

def LIR(n):
	return [LI() for i in range(n)]

def SR(n):
	return [S() for i in range(n)]

def LSR(n):
	return [LS() for i in range(n)]
sys.setrecursionlimit(1000000)
mod = 1000000007

def A():
	n = I()
	a = LI()
	a.sort()
	f = [1] * n
	p = 0
	ans = 0
	while p < n:
		while p < n and (not f[p]):
			p += 1
		if p == n:
			break
		ans += 1
		for i in range(n):
			if a[i] % a[p] == 0:
				f[i] = 0
	print(ans)
	return

def B():
	return

def C():
	return

def D():
	return

def E():
	return

def F():
	return

def G():
	return

def H():
	return

def __starting_point():
	A()
__starting_point()


size = int(input())
li = list(map(int, input().split()))
count = 0
li = sorted(li)
while len(li) != 0:
	m = min(li)
	li = [i for i in li if i % m != 0]
	count += 1
print(count)


n = int(input())
ln = [int(i) for i in input().split(' ')]
ln = sorted(ln)
mst = 0
msind = -1
t = 0
while len(ln) > 0:
	msind = 0
	for i in range(len(ln) - 1, -1, -1):
		if ln[i] % ln[msind] == 0:
			if msind >= i:
				msind -= 1
			del ln[i]
	t += 1
print(t)


n = int(input())
a = list(map(int, input().split()))
turn = 0
while len(a) > 0:
	m = min(a)
	b = []
	for d in a:
		if d % m != 0:
			b.append(d)
	turn += 1
	a = b
print(turn)


_ = int(input())
arr = [int(x) for x in input().strip().split()]
arr.sort()
count = 0
while arr:
	divisor = arr.pop(0)
	if divisor == -1:
		continue
	count += 1
	popList = []
	for index in range(len(arr)):
		if arr[index] % divisor == 0:
			popList.append(index)
	for index in popList:
		arr[index] = -1
print(count)


a = int(input())
b = input().split()
d = []
kek = []
ans = 0
for i in b:
	d.append(int(i))
d = sorted(d)
for i in d:
	l = i
	if l not in kek:
		for j in range(len(d)):
			if d[j] != 0 and d[j] % l == 0:
				d[j] = l
d = set(d)
print(len(d))


n = int(input())
nums = [int(x) for x in input().split()]
nums = sorted(set(nums))
nu = len(nums)
cols = [0] * n
d = dict()
for x in range(nu):
	if not cols[x]:
		cols[x] = 1
		d[nums[x]] = 1
	for y in range(x + 1, nu):
		if not cols[y] and nums[y] % nums[x] == 0:
			cols[y] = 1
			d[nums[x]] = 1
print(len(d))


n = int(input())
c = 0
s = sorted(list(map(int, input().split())))
for j in range(n):
	l = s
	s = []
	x = len(l)
	for i in range(x):
		if l[i] % l[0] != 0:
			s.append(l[i])
	c += 1
	if len(s) == 0:
		break
print(c)


n = int(input())
a = list(map(int, input().split()))
b = []
i = 0
c = n - 1
while a != []:
	b.append([])
	b[i].append(min(a))
	l = 0
	while l != c + 1:
		if a[l] % b[i][0] == 0:
			del a[l]
			c -= 1
			l -= 1
		l += 1
	i += 1
print(i)


def main():
	n = int(input())
	arr = [int(i) for i in input().split()]
	print(count(n, arr))

def count(n, arr):
	s = set()
	for i in range(n):
		s.add(arr[i])
	s = list(s)
	s = sorted(s)
	vis = [False] * len(s)
	l = len(s)
	res = 0
	for i in range(l):
		if vis[i] == False:
			res += 1
			for j in range(i, l):
				if s[j] % s[i] == 0:
					vis[j] = True
	return res
main()


from sys import stdin
import math
n = int(stdin.readline())
arr = list(map(int, stdin.readline().split()))
arr.sort()
k = 0
b = 0
p = [False for _ in range(n)]
while k < n:
	if p[k] == False:
		p[k] = True
		b += 1
		for e in range(k + 1, n):
			if p[e] == False and arr[e] % arr[k] == 0:
				p[e] = True
	k += 1
print(b)


n = int(input())
a = list(map(int, input().split()))
b = []
a.sort()
m = 0
for i in a:
	if all((i % d != 0 for d in b)):
		m += 1
		b.append(i)
print(m)


n = int(input())
arr = list(map(int, input().split()))
lis = arr.copy()
arr.sort()
c = lis.count(-1)
ans = 0
for i in range(n):
	for j in range(n):
		if lis[j] % arr[i] == 0:
			lis[j] = -1
	if lis.count(-1) > c:
		ans += 1
		c = lis.count(-1)
print(ans)


n = int(input())
ar = list(map(int, input().split()))
ar.sort()
used = [0] * n
kol = 0
for i in range(n):
	if used[i] == 0:
		for j in range(i + 1, n):
			if used[j] != 1:
				if ar[j] % ar[i] == 0:
					used[j] = 1
		used[i] = 1
		kol += 1
print(kol)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
s = set()
c = 0
for e in a:
	if e in s:
		continue
	c += 1
	for e2 in a:
		if e2 % e == 0:
			s.add(e2)
print(c)


n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n):
	for j in range(i + 1, n):
		if a[j] != 0 and a[i] != 0 and (a[j] % a[i] == 0):
			a[j] = 0
color = [1 if v != 0 else 0 for v in a]
print(sum(color))


n = int(input())
a = input().split()
a = list(map(int, a))
a.sort()
count = 0
while len(a) > 0:
	cur = a[0]
	count += 1
	i = 0
	while i < len(a):
		if a[i] % cur == 0:
			del a[i]
		else:
			i += 1
print(count)


import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
used = []
A.sort()
for a in A:
	must = True
	for u in used:
		if a % u == 0:
			must = False
			break
	if must:
		used.append(a)
print(len(used))


from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 7

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b):
	return abs(a[0] - b[0]) + abs(b[1] - a[1])

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def arrIN(x=' '):
	return list(map(int, sys.stdin.readline().strip().split(x)))

def eld(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	st = en = be = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
			st = be
			en = i
		if meh < 0:
			meh = 0
			be = i + 1
	return (msf, st, en)

def ncr(n, r):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % MOD
		den = den * (i + 1) % MOD
	return num * pow(den, MOD - 2, MOD) % MOD

def flush():
	return sys.stdout.flush()

def fac(n):
	ans = 1
	for i in range(1, n + 1):
		ans *= i
		ans %= MOD
	return ans
n = int(input())
a = arrIN()
a.sort()
f = [1] * n
cnt = 0
for i in range(n):
	if f[i]:
		cnt += 1
		for j in range(i, n):
			if f[j] and a[j] % a[i] == 0:
				f[j] = 0
		f[i] = 0
print(cnt)


a = int(input())
b = [int(i) for i in input().strip().split()]
b.sort()
ans = []
ans.append(b[0])
for i in range(1, len(b)):
	flag = 0
	for j in ans:
		if b[i] % j == 0:
			flag = 1
			break
	if flag == 0:
		ans.append(b[i])
print(len(ans))


n = int(input())
arr = [int(i) for i in input().split()]
arr.sort()
taken = [0] * n
colours = 0
for i in range(n):
	if taken[i]:
		continue
	colours += 1
	taken[i] = 1
	for j in range(n):
		if arr[j] % arr[i] == 0:
			taken[j] = 1
	if all(taken):
		break
print(colours)


n = int(input())
a = list(set([int(x) for x in input().split()]))
a.sort()
n = len(a)
inq = [True] * n
cnt = 0
for i in range(n):
	if inq[i]:
		cnt += 1
		for j in range(i, n):
			if a[j] % a[i] == 0:
				inq[j] = False
print(cnt)


n = int(input())
a = list(map(int, input().split(' ')))
a.sort()
mark = [False for i in range(n)]
ans = 0
for i in range(n):
	if not mark[i]:
		mark[i] = True
		ans += 1
		for j in range(i + 1, n):
			if a[j] % a[i] == 0:
				mark[j] = True
print(ans)


a = int(input())
b = list(map(int, input().split()))
cnt = 0
sch = 0
b.sort()
while cnt < a:
	sch += 1
	b.sort()
	x = b[0]
	for i in range(a):
		if b[i] % x == 0:
			cnt += 1
			b[i] = 101
print(sch)


n = int(input())
dat = list(map(int, input().split()))
used = [False] * n
dat.sort()
res = 0
for i in range(n):
	if used[i] is True:
		continue
	used[i] = True
	res += 1
	for j in range(i + 1, n):
		if used[j] is True:
			continue
		if dat[j] % dat[i] == 0:
			used[j] = True
print(res)


n = int(input())
A = list(map(int, input().split()))
A.sort()
Used = [False] * n
ans = 0
for (i, a) in enumerate(A):
	if Used[i]:
		continue
	Used[i] = True
	ans += 1
	for (j, b) in enumerate(A):
		if b % a == 0:
			Used[j] = True
print(ans)


def min(a):
	m = 101
	for i in range(len(a)):
		if a[i] < m:
			m = a[i]
	return m
n = int(input())
a = input().split(' ')
for i in range(n):
	a[i] = int(a[i])
c = 0
while True:
	m = min(a)
	if m == 101:
		break
	c += 1
	for i in range(n):
		if a[i] % m == 0:
			a[i] = 101
print(c)


n = int(input())
l = list(map(int, input().split()))
k = list(set(sorted(l)))
g = []
for i in range(len(k)):
	for j in range(n):
		if l[j] != 0 and l[j] % k[i] == 0:
			l[j] = 0
			g.append(k[i])
print(len(set(g)))


n = int(input())
s = sorted(list(set(map(int, input().split()))))
d = {i: 0 for i in s}
y = 0
for i in range(len(s)):
	if d[s[i]] == 0:
		y += 1
		for j in range(i + 1, len(s)):
			if s[j] % s[i] == 0:
				d[s[j]] = 1
		d[s[i]] = 1
print(y)


def f(lst, till=0):
	if not lst:
		return 0
	if len(lst) == 1:
		return 1
	i = 1
	while i < len(lst):
		if lst[i] % lst[0] == 0:
			del lst[i]
		else:
			i += 1
	del lst[0]
	return 1 + f(lst)
n = int(input().strip())
nums = [int(x) for x in input().strip().split()]
print(f(sorted(nums)))


line = input()
nums = [int(item) for item in input().split()]
nums = sorted(set(nums))
elementary = []
for num in nums:
	skip_num = False
	for el in elementary:
		if num % el == 0:
			skip_num = True
			break
	if not skip_num:
		elementary.append(num)
print(len(elementary))


import sys
from collections import defaultdict
input = lambda : sys.stdin.readline().rstrip()

def check(n):
	for i in range(2, n):
		if n % i == 0:
			return False
	return True
n = int(input())
arr = sorted(list(map(int, input().split())))
d = defaultdict(int)
for i in arr:
	flag = True
	for (j, k) in d.items():
		if i % j == 0:
			flag = False
			break
	if flag:
		d[i] = True
print(len(d))


def solve(n, a):
	a = sorted(a)
	col = [False for i in range(n)]
	count = 0
	for i in range(n):
		if not col[i]:
			count += 1
			col[i] = True
			for j in range(n):
				if a[j] % a[i] == 0:
					col[j] = True
	return count
n = int(input())
a = list(map(int, input().split()))
print(solve(n, a))


n = int(input())
ar = [int(i) for i in input().split()]
ar.sort()
count = 0
while ar:
	tmp = ar[0]
	ar.pop(0)
	count += 1
	i = 0
	while i < len(ar):
		if ar[i] % tmp == 0:
			ar.pop(i)
		else:
			i += 1
print(count)


def minColors(arr):
	color = 0
	done = set()
	arr = sorted(arr)
	for i in range(len(arr)):
		if arr[i] not in done:
			color += 1
			done.add(arr[i])
		for j in range(len(arr)):
			if arr[i] == arr[j]:
				continue
			if arr[j] % arr[i] == 0:
				done.add(arr[j])
	return color
n = int(input())
arr = list(map(int, input().split()))
print(minColors(arr))


import sys
import collections
input = sys.stdin.readline

def printnl(val):
	sys.stdout.write(str(val) + '\n')
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(n):
	canPaint = False
	for j in range(0, i):
		if a[i] % a[j] == 0:
			canPaint = True
	if not canPaint:
		ans += 1
print(ans)


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
cnt = 0
while True:
	temp = []
	for i in range(len(arr)):
		if arr[i] % arr[0] != 0:
			temp.append(arr[i])
	arr = temp
	cnt += 1
	if arr == []:
		break
print(cnt)


def how_many_colors(n, seq):
	seq = list(set(seq))
	seq.sort()
	total_colors = 0
	func = lambda x, div: x % div == 0
	while len(seq) > 0:
		div = seq[0]
		seq = [x for x in seq if x % div != 0]
		total_colors += 1
	return total_colors
n = int(input())
seq = list(map(int, input().split()))
print(how_many_colors(n, seq))


from sys import stdin
n = int(stdin.readline())
lst = list((int(x) for x in stdin.readline().split()))
lst.sort()
ans = 0
while len(lst) > 0:
	c = lst[0]
	lst = list((x for x in lst if x % c != 0))
	ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
k = 0
while len(a):
	k += 1
	m = a[0]
	i = 0
	while i < n:
		if a[i] % m == 0:
			a.remove(a[i])
			n -= 1
		else:
			i += 1
print(k)


n = int(input())
L = list(map(int, input().split()))
colors = 0
while len(L) > 0:
	colors += 1
	x = min(L)
	i = 0
	while i < len(L):
		if L[i] % x == 0:
			del L[i]
			i -= 1
		i += 1
print(colors)


def paint():
	total = input()
	unique = [] * int(total)
	inputs = list(map(int, input().split()))
	counter = 0
	inputs.sort()
	for x in inputs:
		if x not in unique:
			unique.append(x)
	val = [False] * len(unique)
	for z in range(len(unique)):
		for p in range(len(unique)):
			if unique[z] < unique[p] and unique[p] % unique[z] == 0 and (val[p] != True):
				val[p] = True
				counter = counter + 1
	if len(unique) == 0:
		print(1)
	else:
		print(len(unique) - counter)
paint()


n = int(input())
a = list(map(int, input().split()))
a.sort()
abs = []
for i in range(n):
	ans = 0
	for j in range(i + 1, n):
		if a[i] == -1:
			break
		if a[j] % a[i] == 0 and a[j] != -1:
			ans += 1
			a[j] = -1
	if ans == 0 and a[i] != -1:
		abs.append(0)
	a[i] = -1
	if ans > 0:
		abs.append(ans)
print(len(abs))


n = int(input())
a = sorted([int(x) for x in input().split()])
counter = 0
test = [False] * n
for j in range(n):
	if not test[j]:
		for i in range(n):
			if not test[i] and a[i] % a[j] == 0:
				test[i] = True
		counter += 1
print(counter)


SIZE = 101
(n, a) = (int(input()), list(map(int, input().split())))
b = [0] * SIZE
for i in range(n):
	b[a[i]] = 1
cnt = 0
for i in range(SIZE):
	if b[i] == 1:
		cnt += 1
		for j in range(i, SIZE, i):
			b[j] = 0
print(cnt)


n = int(input())
lt = list(map(int, input().split()))
lt.sort()
st = set(lt)
l2 = list(st)
l3 = l2.copy()
for i in st:
	for j in range(len(l3)):
		if not l3[j] == i and l3[j] % i == 0 and (l3[j] in l2):
			l2.remove(l3[j])
print(len(l2))


n = int(input())
a = list(map(int, input().split()))
a.sort()
l = [a[0]]
for i in a:
	for j in l:
		if i % j == 0:
			break
	else:
		l.append(i)
print(len(l))


n = int(input())
l = sorted(list(map(int, input().split())))
k = 0
for i in range(n):
	if l[i] == 0:
		continue
	for j in range(n):
		if i != j and l[j] != 0:
			if l[j] % l[i] == 0:
				l[j] = 0
print(n - l.count(0))


n = int(input())
a = list(sorted(map(int, input().split())))
ans = 0
divs = []
for x in a:
	if all((x % d != 0 for d in divs)):
		ans += 1
		divs.append(x)
print(ans)


import sys
input = sys.stdin.readline
n = int(input())
A = list(map(int, input().split()))
A.sort()
ANS = [0] * n
NOW = 1
for i in range(n):
	if ANS[i] == 0:
		ANS[i] = NOW
		for j in range(i, n):
			if A[j] % A[i] == 0 and ANS[j] == 0:
				ANS[j] = NOW
		NOW += 1
print(max(ANS))


n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
ans = 0
while a:
	m = a.pop()
	a = [i for i in a if i % m]
	ans += 1
print(ans)


n = int(input())
a = [int(x) for x in input().split()]
a.sort()
zafarbene = set()
farieb = 0
for i in range(n):
	if a[i] in zafarbene:
		continue
	else:
		farieb += 1
		for j in range(100 // a[i]):
			zafarbene.add((j + 1) * a[i])
print(farieb)


n = int(input())
a = list(map(int, input().split()))
t = a
count = 0
if 1 in a:
	count = 1
else:
	while a:
		count += 1
		x = min(t)
		t = [i for i in a if i % x != 0]
		a = t
print(count)


n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
b = []
while len(a) != 0:
	x = a[0]
	ans += 1
	for i in range(1, len(a)):
		if a[i] % x != 0:
			b.append(a[i])
	a = b
	b = []
print(ans)


n = int(input())
spisok = []
spisok = input().split(' ')
for i in range(len(spisok)):
	spisok[i] = int(spisok[i])
spisok.sort()
spisok.reverse()
k = 0
while len(spisok) != 0:
	a = spisok.pop()
	x = 0
	while x < len(spisok) and len(spisok) != 0:
		if spisok[x] % a == 0:
			del spisok[x]
		else:
			x += 1
	k += 1
print(k)


def find(A):
	A = sorted(A)
	checked = [0] * len(A)
	count = 0
	for i in range(len(A)):
		if checked[i] == 0:
			for j in range(i + 1, len(A)):
				if A[j] % A[i] == 0:
					checked[j] = 1
			count += 1
	return count
N = int(input())
A = list(map(int, input().strip().split(' ')))
print(find(A))


n = int(input())
l = list(map(int, input().split()))
l.sort()
c = 0
while len(l) > 0:
	w = 0
	for i in range(1, len(l), 1):
		if l[i] % l[0] == 0:
			l[i] = 0
			w += 1
	l[0] = 0
	for j in range(w + 1):
		l.remove(0)
	c += 1
print(c)


n = int(input())
A = list(map(int, input().split()))
A.sort()
count = 0
while A:
	count += 1
	min = A[0]
	j = 0
	while j < len(A):
		if A[j] % min == 0:
			del A[j]
			j -= 1
		j += 1
print(count)


import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def revn(n):
	m = 0
	while n > 0:
		m = m * 10 + n % 10
		n = n // 10
	return m
n = ii()
a = sorted(set(li()))
if 1 in a or n == 1:
	print(1)
else:
	for i in range(1, len(a)):
		for j in range(i):
			if a[j] != 0 and a[i] % a[j] == 0:
				a[i] = 0
	print(len(a) - a.count(0))


n = int(input())
nums = [int(i) for i in input().split()]
nums.sort()
c = 0
left = []
while nums:
	i = 0
	while i < len(nums):
		if nums[i] % nums[0] != 0:
			left.append(nums[i])
			i += 1
		else:
			i += 1
	c += 1
	nums = left[:]
	left.clear()
print(c)


n = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * n
ans = 0
for i in range(n):
	if B[i] == 0:
		ans += 1
		B[i] = 1
		for j in range(n):
			if A[j] % A[i] == 0:
				B[j] = 1
print(ans)


import sys
input = sys.stdin.readline
from collections import defaultdict as dc
from collections import Counter
from bisect import bisect_right, bisect_left, bisect
import math
from operator import itemgetter
from heapq import heapify, heappop, heappush
n = int(input())
l = sorted(list(map(int, input().split())))
f = [0] * n
c = 0
for i in range(n):
	if f[i] == 0:
		c += 1
		f[i] = 1
		for j in range(i + 1, n):
			if f[j] == 0:
				if l[j] % l[i] == 0:
					f[j] = 1
print(c)


n = int(input())
A = list(map(int, input().split()))
seti = set()
A.sort()
for i in range(n):
	f = 1
	for el in seti:
		if A[i] % el == 0:
			f = 0
		if el % A[i] == 0:
			seti.add(A[i])
	if f:
		seti.add(A[i])
print(len(seti))


n = int(input())
s = list(map(int, input().split()))
t = 0
while len(s) != 0:
	m = min(s)
	s = [x for x in s if x % m != 0]
	t += 1
print(t)


n = int(input())
arr = [int(c) for c in input().split()]
arr.sort()
check = [arr[0]]
for i in range(n):
	j = 0
	while j < len(check):
		if arr[i] % check[j] != 0:
			j = j + 1
		else:
			j = len(check) + 1
	if j == len(check):
		check.append(arr[i])
print(len(check))


def peel(xs):
	return [x for x in xs if x % xs[0] != 0]

def main():
	n = int(input().strip())
	xs = [int(x) for x in input().split()]
	xs = sorted(xs)
	count = 0
	while len(xs) > 0:
		count += 1
		xs = peel(xs)
	print(count)
main()


import sys
input = sys.stdin.readline
n = int(input())
a = sorted(list(set(map(int, input().split()))))
n = len(a)
used = [0] * n
cnt = 0
for i in range(n):
	if not used[i]:
		used[i] = 1
		cnt += 1
		for j in range(i + 1, n):
			if a[j] % a[i] == 0:
				used[j] = 1
print(cnt)


import sys

def rint():
	return map(int, sys.stdin.readline().split())
n = int(input())
a = rint()
a = set(a)
a = list(a)
a.sort()
for i in range(len(a) - 1):
	aa = a[i]
	if aa == 0:
		continue
	for j in range(i + 1, len(a)):
		if a[j] == 0:
			continue
		if a[j] % aa == 0:
			a[j] = 0
cnt = 0
for i in range(len(a)):
	if a[i]:
		cnt += 1
print(cnt)


import itertools
import functools

def read_ints():
	return map(int, input().split())
length = int(input())
weights = [1] * length
arr = list(read_ints())
order = sorted(arr)
col_count = 0
while len(weights) > 0:
	prev = itertools.compress(order, weights)
	el = next(prev)
	leftover = []
	for i in prev:
		if not i % el:
			pass
		else:
			leftover.append(i)
	col_count += 1
	weights = [1] * len(leftover)
	order = sorted(leftover)
print(col_count)


n = int(input())
a = sorted(map(int, input().split()))
ans = 0
for i in range(n):
	f = 1
	for j in range(i):
		if a[i] % a[j] == 0:
			f = 0
			break
	ans += f
print(ans)


n = int(input())
l = list(set(list(map(int, input().split()))))
l.sort()
n = len(l)
done = [0] * n
c = 0
for i in range(n):
	if done[i] == 0:
		for j in range(i + 1, n):
			if l[j] % l[i] == 0:
				done[j] = 1
		c += 1
		done[i] = 1
print(c)


n = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 1
s = {a[0]}
for i in range(1, n):
	ai = a[i]
	for el in s:
		if ai % el == 0:
			break
	else:
		s.add(ai)
		ans += 1
print(ans)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
vis = [False for i in range(n)]
cnt = 0
for i in range(n):
	if vis[i] == False:
		vis[i] = True
		cnt += 1
		for j in range(i + 1, n):
			if vis[j] == False:
				if a[j] % a[i] == 0:
					vis[j] = True
print(cnt)


size = int(input())
arr = list(map(int, input().split(' ')))
arr = list(set(arr))

def isDivisible(num, arr):
	return len([i for i in arr if num % i == 0 and i != num]) == 0
print(len([i for i in arr if isDivisible(i, arr)]))


import math
n = int(input())
l = input()
la = [int(s) for s in l.split()]
la.sort()
ld = [la[0]]
for a in la[1:]:
	c = True
	for d in ld:
		if a % d == 0:
			c = False
	if c is True:
		ld.append(a)
print(len(ld))


prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
n = int(input())
lst = [int(i) for i in input().split()]

def main(n, lst):
	if 1 in lst:
		return 1
	d = {}
	new_lst = []
	for i in range(len(lst)):
		if lst[i] in prime:
			d[lst[i]] = 0
		elif lst[i] == 0:
			d[0] = 0
		else:
			new_lst.append(lst[i])
	new_lst.sort()
	for e in new_lst:
		added = 0
		for k in d:
			if e % k == 0:
				d[k] += 1
				added = 1
		if not added:
			d[e] = 0
	return len(d)
print(main(n, lst))


n = int(input())
l = list(set(map(int, input().split())))
l = list(sorted(l))
ans = [l[0]]
for i in l:
	if any((i % j == 0 for j in ans)):
		continue
	else:
		ans.append(i)
print(len(ans))


int(input())
l = list(map(int, input().split()))
c = 0
while len(l) > 0:
	l = list(filter(lambda x: x % min(l) != 0, l))
	c += 1
print(c)


n = int(input())
a = sorted([*map(int, input().split())])
ans = 0
while a:
	ans += 1
	a = [i for i in a if i % a[0] != 0]
print(ans)


n = int(input())
a = list(map(int, input().split()))
a.sort()
res = 0
for i in range(n):
	c = 0
	for j in range(i):
		if a[i] % a[j] == 0:
			c = 1
			break
	if c == 0:
		res += 1
print(res)


k = int(input())
a = [int(i) for i in input().split()]
a.sort()
temp = [a[0]]
for i in range(k):
	flag = 0
	for j in temp:
		if a[i] % j == 0:
			flag = 1
	if flag == 0 and a[i] not in temp:
		temp.append(a[i])
print(len(temp))


n = int(input())
lst1 = list(map(int, input().split()))
lst1.sort()
lst2 = []
lst2.append(lst1[0])
for i in range(1, n):
	flag = False
	for j in range(len(lst2)):
		if lst1[i] % lst2[j] == 0:
			flag = True
			break
	if not flag:
		lst2.append(lst1[i])
print(len(lst2))


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
a = set(a)
a = list(a)
l = len(a)
tag = [1 for i in range(l)]
if l == 1:
	print(1)
else:
	count = 0
	for i in range(l):
		if not tag[i]:
			continue
		tag[i] = 0
		for j in range(l):
			if a[j] % a[i] == 0 and tag[j]:
				tag[j] = 0
		count += 1
	print(count)


n = int(input())
s = map(int, input().split())
s = list(s)
ss = s.copy()
c = 0
while len(s) != 0:
	a = min(s)
	for i in range(len(s)):
		if s[i] % a == 0:
			ss.remove(s[i])
		else:
			continue
	s = ss.copy()
	c = c + 1
print(c)


def find_min():
	y = 101
	for i in range(n):
		if a[i] < y and a[i] > 0:
			y = a[i]
	return y
n = int(input())
a = [int(i) for i in input().split()]
m = find_min()
ans = 0
while m != 101:
	ans += 1
	for i in range(n):
		if a[i] % m == 0:
			a[i] = 0
	m = find_min()
print(ans)


n = int(input())
ls = [int(a) for a in input().split()]
ls.sort()
an = [ls[0]]
for i in range(n):
	found = False
	for j in range(len(an)):
		if ls[i] % an[j] == 0:
			found = True
	if found == False:
		an.append(ls[i])
print(len(an))


n = int(input())
U = []
L = sorted(list(set((int(x) for x in input().split()))))
while L != []:
	C = [x for (ind, x) in enumerate(L) if x % L[0] == 0]
	for x in C:
		L.remove(x)
	U.append(C)
print(len(U))


n = int(input())
a = list(map(int, input().split()))
cnt = 0
while len(a) > 0:
	a = list(filter(lambda x: x % min(a) != 0, a))
	cnt += 1
print(cnt)


n = int(input().strip())
arr = sorted(list(set(list(map(int, input().split())))))
mul_arr = [arr[0]]
for i in range(len(arr)):
	j = 0
	while j != len(mul_arr) and arr[i] % mul_arr[j] != 0:
		j += 1
	if j == len(mul_arr):
		mul_arr.append(arr[i])
print(len(mul_arr))


c = int(input())
c1 = [int(i) for i in input().split()]
c1 = sorted(c1)
c2 = [c1[0]]
for i in range(1, len(c1)):
	t = True
	for j in c2:
		if c1[i] % j == 0:
			t = False
	if t:
		c2.append(c1[i])
print(len(c2))


n = int(input())
x = [int(i) for i in input().split()]
x.sort()
a = [0] * n
counter = 0
for i in range(n):
	if a[i] == 0:
		counter += 1
		a[i] = 1
		d = x[i]
		for j in range(i + 1, n):
			if x[j] % d == 0:
				a[j] = 1
print(counter)


from math import gcd

def main():
	input()
	seq = [int(c) for c in input().split()]
	seq.sort()
	check = [0] * len(seq)
	for i in range(len(seq)):
		if seq[i] == -1000:
			continue
		check[i] = 1
		for j in range(i + 1, len(seq)):
			if seq[j] != -1000:
				if seq[j] % seq[i] == 0:
					seq[j] = -1000
	print(sum(check))
main()


n = int(input())
a = [int(item) for item in input().split()]
a.sort()
color = 0
for i in range(n):
	unseen = True
	for j in range(i):
		if a[i] % a[j] == 0:
			unseen = False
			break
	if unseen:
		color += 1
print(color)


amount = int(input())
array = [int(s) for s in input().split()]
array = sorted(array)
counter = 1
divs = [array[0]]
for i in range(1, len(array)):
	flag = False
	for j in range(len(divs)):
		if array[i] % divs[j] == 0:
			flag = True
	if not flag:
		divs.append(array[i])
print(len(divs))


n = int(input())
l = list(map(int, input().split()))
l.sort()
l1 = []
s = c = 0
while len(l) > 0:
	a = l[0]
	l1 = [a]
	s += 1
	for i in range(1, len(l)):
		if l[i] % a == 0:
			l1.append(l[i])
	for i in l1:
		l.remove(i)
print(s)


from math import ceil
n = int(input())
l = [int(i) for i in input().split(' ')]
p = [-1 for i in range(n)]
p[0] = 1
l.sort()
c = 1
for i in range(0, n):
	if i == 0 or p[i] == -1:
		p[i] = c
		for j in range(i + 1, n):
			if p[j] == -1:
				if l[j] % l[i] == 0:
					p[j] = c
		c += 1
print(max(p))


n = int(input().strip())
A = [int(i) for i in input().strip().split(' ')]
D = A.copy()
for i in range(n):
	for j in range(i + 1, n):
		if D[i] == D[j]:
			continue
		d = min(D[i], D[j])
		if A[i] % d == 0:
			D[i] = d
		if A[j] % d == 0:
			D[j] = d
print(len(set(D)))


n = int(input())
A = [*map(int, input().split())]
A.sort()
count = 0
for i in range(len(A)):
	a = A[i]
	if a == -1:
		continue
	count += 1
	for j in range(i + 1, len(A)):
		if A[j] % a == 0:
			A[j] = -1
print(count)


def main():
	_ = int(input())
	lst = sorted(set(map(int, input().split())))
	seen = [False] * len(lst)
	ans = 0
	for (i, x) in enumerate(lst):
		if not seen[i]:
			ans += 1
		for (j, y) in enumerate(lst):
			if y % x == 0:
				seen[j] = True
	print(ans)
main()


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
b = []
for i in a:
	k = 0
	for j in b:
		if i % j == 0:
			k = 1
			break
	if k == 0:
		b += [i]
print(len(b))


n = int(input())
ar = list(map(int, input().split()))
rem = n
ans = 0
while rem > 0:
	mn = 10 ** 19
	for i in range(n):
		if ar[i] != 0:
			mn = min(mn, ar[i])
	for i in range(n):
		if ar[i] != 0 and ar[i] % mn == 0:
			ar[i] = 0
			rem -= 1
	ans += 1
print(ans)


n = int(input())
l = set(map(int, input().split()))
c = 0
m = min(l)
while l:
	c += 1
	m = min(l)
	for i in range(m, 101, m):
		l -= {i}
print(c)


gi = lambda : list(map(int, input().split()))
(n,) = gi()
l = gi()
ans = 0
v = [0] * n
k = 0
l.sort()
while k < n:
	if v[k]:
		k += 1
		continue
	e = l[k]
	flag = 1
	for j in range(n):
		if l[j] % e == 0:
			flag = 0
			v[j] = 1
	if flag:
		break
	ans += 1
	k += 1
print(ans)


x = int(input())
p = list(map(int, input().split()))
t = 0
while p:
	m = min(p)
	p = [x for x in p if x % m != 0]
	t += 1
print(t)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
vals = list(map(int, input().split()))
vals.sort()
colours = [-1 for s in range(n)]
for s in range(n):
	if colours[s] == -1:
		colours[s] = s
		for b in range(n):
			if s != b and colours[b] == -1:
				if vals[b] % vals[s] == 0:
					colours[b] = s
print(len(set(colours)))


x = int(input())
a = list(map(int, input().split()))
s = 0
i = 0
d = 0
for j in range(len(a)):
	z = min(a)
	b = []
	for k in range(len(a)):
		if a[k] % z != 0:
			b.append(a[k])
		else:
			s = s + 1
	a = b.copy()
	b = b.clear()
	d = d + 1
	if s == x:
		break
print(d)


from collections import deque
n = int(input())
a = list(map(int, input().split()))
a.sort()
cnt = 0
done = deque()
i = 0
while len(done) < n and i <= 100:
	x = len(done)
	if i not in done:
		for j in range(n):
			if j not in done and a[j] % a[i] == 0:
				done.append(j)
	i += 1
	if x != len(done):
		cnt += 1
print(cnt)


n = int(input())
l = sorted(map(int, input().split()))
seen = [False] * n
res = 0
for i in range(n):
	if seen[i]:
		continue
	res += 1
	for j in range(i, n):
		seen[j] |= l[j] % l[i] == 0
print(res)


n = int(input())
a = list(map(int, input().split(' ')))
ans = 0
while n:
	min_a = min(a)
	ans += 1
	i = 0
	while i < n:
		if a[i] % min_a == 0:
			(a[i], a[-1]) = (a[-1], a[i])
			a.pop()
			n -= 1
		else:
			i += 1
print(ans)


n = int(input())
l = list(map(int, input().split()))
s = sorted(list(set(l)))
a = 0
for i in range(len(s)):
	flag = 0
	for j in range(len(s) - 1, -1, -1):
		if s[j] == 0 or s[i] == 0:
			continue
		elif s[j] % s[i] == 0:
			flag = 1
			s[j] = 0
	if flag == 1:
		a += 1
print(a)


n = int(input())
ai = list(map(int, input().split()))
num = [0] * 101
for i in range(n):
	num[ai[i]] = 1
ans = 0
for i in range(1, 101):
	if num[i] == 0:
		continue
	ans += 1
	for j in range(i + 1, 101):
		num[j] &= j % i != 0
print(ans)


n = int(input())
a = list(set(map(int, input().split())))
n = len(a)
cnt = 0
for i in range(n):
	f = True
	for j in range(n):
		if i == j:
			continue
		if a[i] % a[j] == 0:
			f = False
	if f:
		cnt += 1
print(cnt)


n = int(input())
L = list(map(int, input().split()))
s = 0
while L != []:
	L.sort()
	A = [0]
	for i in L:
		if i != L[0]:
			if i % L[0] == 0:
				A.append(i)
	A[0] = L[0]
	T = set(L)
	U = set(A)
	T = T - U
	L = list(T)
	s = s + 1
print(s)


n = int(input())
arr = sorted(set([int(x) for x in input().split()]))
colors = 0
while len(arr) > 0:
	m = min(arr)
	arr = [x for x in arr if x % m != 0]
	colors += 1
print(colors)


n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
b = []
b.append(a[0])
i = 1
k = 1
for i in range(n):
	for j in range(k):
		if a[i] % b[j] == 0:
			break
		elif j == k - 1:
			b.append(a[i])
			k += 1
print(k)


from collections import defaultdict
N = int(input())
ss = defaultdict(int)
arr = list(map(int, input().split()))
arr.sort()
cnt = 0
new_set = list(set(arr))
arr2 = [False] * len(new_set)
for i in range(len(new_set)):
	ok = False
	for y in range(i + 1, len(new_set)):
		if new_set[y] % new_set[i] == 0 and arr2[y] == False and (arr2[i] == False):
			ok = True
			arr2[y] = True
	if ok == False and arr2[i] == False:
		cnt += 1
	elif ok == True:
		cnt += 1
	arr2[i] = True
print(cnt)


n = int(input())
a = input().split(' ')
for i in range(0, len(a)):
	a[i] = int(a[i])
cnt = 0
while len(a) > 0:
	a.sort()
	f = a[0]
	b = []
	l = False
	for i in range(0, len(a)):
		if a[i] % f != 0:
			b.append(a[i])
			l = True
	cnt += 1
	a = b
print(cnt)


import sys
import os
from io import IOBase, BytesIO

def main():
	n = int(input())
	arr = get_array()
	arr.sort()
	tmp = [-1] * n
	c = 1
	for i in range(n):
		if tmp[i] != -1:
			continue
		x = arr[i]
		for j in range(i, n):
			if arr[j] % x == 0:
				tmp[j] = c
		c += 1
	print(c - 1)
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		py2 = round(0.5)
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2 == 1:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline().strip()
main()


n = int(input())
a = [int(i) for i in input().split()]
a.sort()
i = 0
ans = 0
while len(a) != 0:
	div = []
	div.append(a[i])
	for j in range(i + 1, len(a)):
		if a[j] % a[i] == 0:
			div.append(a[j])
	for j in div:
		a.remove(j)
	ans += 1
print(ans)


n = int(input())
arr = list(map(int, input().split()))
arr.sort()
amount = 0
i = 0
ans = 0
used = [0 for _ in range(n)]
while amount != n:
	curr_elem = arr[i]
	if used[i] == 0:
		used[i] = 1
		amount += 1
	else:
		i += 1
		continue
	for j in range(i + 1, n):
		if arr[j] % curr_elem == 0:
			if used[j] == 0:
				amount += 1
				used[j] = 1
	i += 1
	ans += 1
print(ans)


N = int(input())
arr = sorted([int(x) for x in input().split()])
covered = [False] * N
num_covered = 0
colors = 0
while num_covered < N:
	non_cov_idx = 0
	while covered[non_cov_idx]:
		non_cov_idx += 1
	non_covered = arr[non_cov_idx]
	colors += 1
	for idx in range(non_cov_idx, N):
		if arr[idx] % non_covered == 0 and (not covered[idx]):
			num_covered += 1
			covered[idx] = True
print(colors)


input()
data = sorted(map(int, input().split()))
dividors = []
for v in data:
	found = False
	for d in dividors:
		if v % d == 0:
			found = True
			break
	if not found:
		dividors.append(v)
print(len(dividors))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def IF(c, t, f):
	return t if c else f

def YES(c):
	return IF(c, 'YES', 'NO')

def Yes(c):
	return IF(c, 'Yes', 'No')

def main():
	t = 1
	rr = []
	for _ in range(t):
		n = I()
		a = LI()
		a.sort()
		v = [None] * n
		r = 0
		for i in range(n):
			if v[i]:
				continue
			r += 1
			t = a[i]
			for j in range(i + 1, n):
				if v[j] is None and a[j] % t == 0:
					v[j] = True
		rr.append(r)
	return JA(rr, '\n')
print(main())


from copy import copy

def solve_a():
	n = int(input())
	numbers = set((int(x) for x in input().split()))
	count = 0
	while len(numbers) > 0:
		mn = min(numbers)
		count += 1
		for num in copy(numbers):
			if num % mn == 0:
				numbers.remove(num)
	print(count)
solve_a()


n = int(input())
a = set(map(int, input().split()))
colors = 0
while a:
	m = min(list(a))
	for i in list(a):
		if i % m == 0:
			a.remove(i)
	colors += 1
print(colors)


from copy import deepcopy
n = int(input())
shelf = [int(i) for i in input().split()]
num = 0
while shelf:
	copied = deepcopy(shelf)
	key = min(shelf)
	for i in shelf:
		if i % key == 0:
			copied.remove(i)
	num += 1
	shelf = copied
print(num)


import sys

def main():
	n = int(sys.stdin.readline())
	numbers = list(map(int, sys.stdin.readline().split()))
	numbers.sort()
	painted = {}
	check = []
	for i in range(n):
		for j in range(i, n):
			if numbers[j] % numbers[i] == 0:
				if numbers[i] not in painted:
					painted[numbers[i]] = []
					painted[numbers[i]].append(j)
				elif j not in painted[numbers[i]]:
					painted[numbers[i]].append(j)
	count = {}
	for i in painted:
		for j in painted[i]:
			if j not in check:
				check.append(j)
				count[i] = count.get(i, 0) + 1
	sys.stdout.write(f'{len(count)}')
main()


n = int(input())
aa = input()
a = [int(i) for i in aa.split()]
a.sort()
a = tuple(a)
temp = []
for i in range(max(a) + 2):
	temp.append(0)
ct = 0
for i in range(n):
	temp[a[i]] = 1
for i in range(n):
	mul = 0
	if temp[a[i]] != 0:
		while a[i] + mul <= max(a):
			temp[a[i] + mul] = 0
			mul = mul + a[i]
		ct = ct + 1
print(ct)


n = int(input())
l = list(set(list(map(int, input().split()))))
co = 0
l.sort()
while len(l) != 0:
	div = l[0]
	co += 1
	poplist = []
	for i in range(len(l)):
		if l[i] % div == 0:
			poplist.append(i)
	poplist.sort(reverse=True)
	for i in poplist:
		l.pop(i)
print(co)


n = int(input())
A = sorted(map(int, input().split()))
for i in range(n):
	for a in A:
		if a:
			x = a
			break
	else:
		print(i)
		break
	for j in range(n):
		if A[j] % x == 0:
			A[j] = 0
else:
	print(n)


n = int(input())
arr = sorted([int(x) for x in input().split()])
cnt = 0
for i in range(n):
	b = False
	for j in range(i):
		if arr[i] % arr[j] == 0:
			b = True
			break
	if not b:
		cnt += 1
print(cnt)


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(1):
	n = int(input())
	a = set((int(x) for x in input().split()))
	print(sum((all((x % y for y in a - {x})) for x in a)))


n = int(input())
a = list(map(int, input().split()))
a.sort()
b = []
for i in range(n):
	co = 0
	for j in b:
		if a[i] % j == 0:
			co = 1
			break
	if co == 0:
		b.append(a[i])
print(len(b))


n = int(input())
x = input()
xx = x.split()
for i in range(0, n):
	xx[i] = int(xx[i])
xx.sort()
a = [xx[0]]
g = 1
for i in xx:
	q = 0
	for j in range(0, len(a)):
		if i % a[j] != 0:
			q += 1
	if q == len(a):
		a.append(i)
		g += 1
print(g)


import math
t = input()
a = list(set(map(int, input().split())))
a.sort()
algehad = set([])
for x in a:
	for y in a:
		if x != y:
			if y % x == 0:
				algehad.add(y)
print(len(a) - len(algehad))


n = int(input())
c = list(map(int, input().split()))
colorCtr = 0
c.sort()
while len(c) != 0:
	num = c[0]
	leng = len(c)
	i = 0
	while i < leng:
		if c[i] % num == 0:
			del c[i]
			leng -= 1
		else:
			i += 1
	colorCtr += 1
print(colorCtr)


n = int(input())
m = [int(x) for x in input().split()]
m = sorted(set(m))
c = 0
while m:
	new = []
	f = m.pop(0)
	for x in m:
		if x % f != 0:
			new.append(x)
	m = new
	c += 1
print(c)


from collections import deque
n = int(input())
a = list(map(int, input().split()))
mins = deque()
m = float('inf')
for el in a:
	for _ in range(len(mins)):
		m = mins.pop()
		if el % m == 0:
			mins.appendleft(m)
			break
		if m % el:
			mins.appendleft(m)
	if el % m:
		mins.appendleft(el)
print(len(mins))


l = int(input())
a = set([int(x) for x in input().split()])
ans = 0
while a:
	mins = min(a)
	a = [x for x in a if x % mins]
	ans += 1
print(ans)


n = int(input())
l = sorted(list(set(map(int, input().split()))))
k = l.copy()
for i in range(0, len(l)):
	for j in range(i + 1, len(l)):
		if l[j] % l[i] == 0:
			if l[j] in k:
				k.remove(l[j])
print(len(k))