Bash has set out on a journey to become the greatest Pokemon master. To get his first Pokemon, he went to Professor Zulu's Lab. Since Bash is Professor Zulu's favourite student, Zulu allows him to take as many Pokemon from his lab as he pleases.

But Zulu warns him that a group of k > 1 Pokemon with strengths {s_1, s_2, s_3, ..., s_{k}} tend to fight among each other if gcd(s_1, s_2, s_3, ..., s_{k}) = 1 (see notes for gcd definition).

Bash, being smart, does not want his Pokemon to fight among each other. However, he also wants to maximize the number of Pokemon he takes from the lab. Can you help Bash find out the maximum number of Pokemon he can take? 

Note: A Pokemon cannot fight with itself.


-----Input-----

The input consists of two lines.

The first line contains an integer n (1 ≤ n ≤ 10^5), the number of Pokemon in the lab.

The next line contains n space separated integers, where the i-th of them denotes s_{i} (1 ≤ s_{i} ≤ 10^5), the strength of the i-th Pokemon.


-----Output-----

Print single integer — the maximum number of Pokemons Bash can take.


-----Examples-----
Input
3
2 3 4

Output
2

Input
5
2 3 4 6 7

Output
3



-----Note-----

gcd (greatest common divisor) of positive integers set {a_1, a_2, ..., a_{n}} is the maximum positive integer that divides all the integers {a_1, a_2, ..., a_{n}}.

In the first sample, we can take Pokemons with strengths {2, 4} since gcd(2, 4) = 2.

In the second sample, we can take Pokemons with strengths {2, 4, 6}, and there is no larger group with gcd ≠ 1.

Difficulty: competition

Starter code:

Solutions:
from collections import Counter
n = int(input())
a = [int(_) for _ in input().split()]
f = Counter(a)
N = 10 ** 5 + 10
p = [0 for i in range(N)]
ans = Counter()
for i in range(2, N):
    if p[i]:
        continue
    for j in range(i, N, i):
        p[j] = 1
        ans[i] += f[j]
print(max(1, ans.most_common(1)[0][1]))


n = int(input().strip())
a = [int(i) for i in input().strip().split()]
f = [0 for i in range(max(a)+1)]
l = len(f)

for i in a:
  f[i]+=1

if f[1]:
  f[1]=1

for i in range(2,l):
  for j in range(2*i,l,i):
    f[i]+=f[j]

print(max(f))


import functools

@functools.lru_cache(maxsize=10000)
def factor(n):
    res = []
    d = 2
    while d * d <= n:
        if n % d == 0:
            res.append(d)
            n //= d
        else:
            d += 1
    if n > 1:
        res.append(n)
    return set(res)

num = int(input())

poks = list(map(int, input().split()))[:num]

c = dict()
for p in poks:
    for d in factor(p):
        if d in c.keys():
            c[d] += 1
        else:
            c[d] = 1
            
if c:
    print(max(c.values()))
else:
    print(1)

n = int(input())
s = list(map(int, input().split()))

pf = [[] for _ in range(10 ** 5 + 1)]
for i in range(2, 10 ** 5 + 1):
    if len(pf[i]) > 0:
        continue
    for j in range(i, 10 ** 5 + 1, i):
        pf[j].append(i)

f = [0] * (10 ** 5 + 1)

for x in s:
    for i in pf[x]:
        f[i] += 1

print(max(1, max(f)))


dict = {}
ans = {}
for i in range(-1,100110): 
	dict[i] = []
	ans[i] = 0
for i in range(2,100010): 
	if dict[i] == []:
		j = i+i
		while j <= 100010:
			#print(dict[j])
			tmp = dict[j]
			tmp += [i]
			dict[j] = tmp
			#print(dict[j])
			j += i
		dict[i] = [i]
n = input()
n = input()
n = n.split(" ")
banyak = 0
for i in n:
	tmp = int(i)
	for j in dict[tmp] : 
		ans[j] += 1
		if ans[j] > banyak : banyak = ans[j]
if (banyak == 0) : banyak = 1
print(banyak)

n=int(input())
ip=list(map(int,input().split()))
m=max(ip)
arr=[0 for i in range(m+1)]
for i in ip:
    arr[i]+=1
ans=0
for i in range(2,m+1):
    j=i
    count=0
    while j<=m:
        count+=arr[j]
        j+=i
    if count>ans:
        ans=count
print(max(ans,1))


def solve(A):
    N = max(A)
    primediv = list(range(N+1))
    for p in range(2, int(N**0.5)+1):
        if primediv[p] == p:
            for i in range(2*p, N+1, p):
                primediv[i] = p

    count = [0] * (N+1)
    for n in A:
        while n != 1:
            p = primediv[n]
            count[p] += 1
            while primediv[n] == p:
                n //= p

    return max(1, max(count))
    
n = int(input())
A = [int(x) for x in input().split()]
print(solve(A))
        


def isPrime(n):
  for i in range(2, int(n ** 0.5) + 1):
    if n % i == 0:
      return False
  return True
    
primes = set()    
    
for i in range(2, 100000):
  if isPrime(i):
    primes.add(i)

c = [1] + [0] * 100000
n = input()

s = list(map(int, input().split()))

x = [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,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313]
for i in s:
  for p in x:
    if i in primes:
      c[i] += 1
      break
    if p**2 > i:
      break
    if i % p == 0:
      c[p] += 1
      while i and i % p == 0:
        i //= p
    
  #if i != 1:
  #  c[i] +=1

m = max(c)
print(m)


M = 10 ** 5

n = int(input())
ss = [int(s) for s in input().split()]

prime_factor = {i: set() for i in range(1, M + 1)}

for p in range(2, M + 1):
    if prime_factor[p] != set():
        continue
    else:
        for i in range(p, M + 1, p):
            prime_factor[i].add(p)

cnt = [0] * (M + 1)

for s in ss:
    for p in prime_factor[s]:
        cnt[p] += 1

print(max(1, max(cnt)))


M = 10 ** 5

n = int(input())
ss = [int(s) for s in input().split()]

prime_factor = [set() for i in range(M + 1)]

for p in range(2, M + 1):
    if prime_factor[p] != set():
        continue
    else:
        for i in range(p, M + 1, p):
            prime_factor[i].add(p)

cnt = [0] * (M + 1)

for s in ss:
    for p in prime_factor[s]:
        cnt[p] += 1

print(max(1, max(cnt)))

n = int(input())
s = [int(i) for i in input().split()]

ans = 1
p = [0] * 100002

for i in s:
    p[i] += 1

for i in range(2, 100002):
    c = 0
    for j in range(i, 100002, i):
        c += p[j]
    ans = max(ans, c)
print(ans)

input()
count = {}
for x in map(int, input().split()):
    d = 2
    while d * d <= x:
        if x % d == 0:
            count[d] = count.get(d, 0) + 1
            while x % d == 0:
                x //= d
        else:
            d += 1
    if x > 1:
        count[x] = count.get(x, 0) + 1
print(max([1] + list(count.values())))



n=int(input())
a=list(map(int,input().split(" ")))
t=max(a)
k=[0]*(t+2)
for el in a:
    k[el]+=1
if k[1]:
    k[1]=1
for j in range(2,t+2):
    for i in range(2*j,t+2,j):
            k[j]+=k[i]
print(max(k))

n = int(input().strip())
a = [int(i) for i in input().strip().split()]
f = [0 for i in range(max(a)+1)]
l = len(f)

for i in a:
  f[i]+=1

if f[1]:
  f[1]=1

for i in range(2,l):
  for j in range(2*i,l,i):
    f[i]+=f[j]

print(max(f))

def main():
	n = input()
	L = [int(x) for x in input().split()]
	print(solver(L))

def solver(L):
	n = max(L)
	nums = [0] * (n + 1)
	for x in L:
		nums[x] += 1
	highestCount = 1
	for i in range(2, n + 1):
		count = sum(nums[i:n+1:i])
		highestCount = max(highestCount, count)
	return highestCount
		#for j in range(i, n + 1, i):
		#	count += 



	# n = max(L)
	# primes = makePrimes(n)
	# highestCount = maxCount(L)
	# for prime in primes:
	# 	if prime > n**0.5:
	# 		break 
	# 	count = len([x for x in L if x % prime == 0])
	# 	if count > highestCount:
	# 		highestCount = count
	# return highestCount

def maxCount(L):
	d = dict()
	for x in L:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	d[1] = 1
	return max([d[x] for x in d])

# print(solver([2, 3, 4]))
# print(solver([3, 9]))
# print(solver([2, 3, 4, 6, 7]))
# print(solver([12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 15, 1, 18, 28, 20, 6, 31, 16, 5, 23, 21, 38, 3, 11, 18, 11, 3, 25, 33]))
# print(solver([1, 1, 1]))
# print(solver([1, 3, 6]))

main()


def main():
	n = input()
	L = [int(x) for x in input().split()]
	print(solver(L))

def solver(L):
	n = max(L)
	nums = [0] * (n + 1)
	for x in L:
		nums[x] += 1
	highestCount = 1
	for i in range(2, n + 1):
		count = 0 
		for j in range(i, n + 1, i):
			count += nums[j]
		#count = sum(nums[i:n+1:i])
		highestCount = max(highestCount, count)
	return highestCount
		#for j in range(i, n + 1, i):
		#	count += 



	# n = max(L)
	# primes = makePrimes(n)
	# highestCount = maxCount(L)
	# for prime in primes:
	# 	if prime > n**0.5:
	# 		break 
	# 	count = len([x for x in L if x % prime == 0])
	# 	if count > highestCount:
	# 		highestCount = count
	# return highestCount

def maxCount(L):
	d = dict()
	for x in L:
		if x in d:
			d[x] += 1
		else:
			d[x] = 1
	d[1] = 1
	return max([d[x] for x in d])

# print(solver([2, 3, 4]))
# print(solver([3, 9]))
# print(solver([2, 3, 4, 6, 7]))
# print(solver([12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 12553, 15, 1, 18, 28, 20, 6, 31, 16, 5, 23, 21, 38, 3, 11, 18, 11, 3, 25, 33]))
# print(solver([1, 1, 1]))
# print(solver([1, 3, 6]))

main()




def __starting_point():
    N = int(input())
    lst2 = list(map(int, input().split()))
    M = max(lst2)
    N=M+100

    lst = [True for _ in range(N)]
    lst[0] = False
    lst[1]= False

    i = 2
    while i < N:
        if lst[i]:
            for j in range(2,1+(N-1)//i):
                lst[i*j]=False
        i += 1

    primes=[i for i in range(N) if lst[i]]
    #print(len(re))






    auxlst = [0]*(M+1)
    for i in lst2:
        auxlst[i] += 1

    result = [0]*(M+1)









    for p in primes:
        if p > M:
            break
        n=p
        for _ in range(M//p):
            result[p] += auxlst[n]
            n += p

    result = max(1,max(result))
    print(result)
    # to make changes

__starting_point()

#!/usr/bin/env pypy3
# -*- coding: UTF-8 -*-

def prime_t(t):
    i=2
    while i**2<=t:
        if t%i==0:
            return 0
        i+=1
    return 1
p=[]

for i in range(2,100001):
    if prime_t(i):
        p.append(i)

n=int(input())
ol=[int(i) for i in input().split()]
l=[i for i in ol if int(i)%2]
ans=max(1,n-len(l))

pd={i:0 for i in p}
for i in ol:
    if i in pd:
        pd[i]+=1
        ans=max(ans,pd[i])
l=[i for i in ol if i not in pd]


ld={}
for i in l:
    if i in ld:
        ld[i]+=1
    else:
        ld[i]=1
setl=set(l)
mol=list(setl)
mol.sort()

for i in mol:
    so=i
    for j in p:
        tmp=1
        if j/2>so:
            break
        elif so%j==0:
            pd[j]+=ld[i]
            while so%j==0:
                so//=j
            ans=max(ans,pd[j],tmp)
print(ans)

import math

N = int(input())

S = [int(s) for s in input().split()]
max_s = max(S)

factors = [set() for i in range(max_s + 1)]
fact_cnt = [0] * (max_s + 1)

for p in range(2, max_s + 1):
    if factors[p] != set():
        continue
    else:
        for i in range(p, max_s + 1, p):
            factors[i].add(p)

# print(factors)

for s in S:
    for p in factors[s]:
        fact_cnt[p] += 1

ans = max(1, max(fact_cnt))

print(ans)

import math

N = int(input())

S = [int(s) for s in input().split()]

factors = {}

for s in S:
    root_s = math.sqrt(s)

    for i in range(2, math.ceil(root_s) + 1, 1):
        if s % i == 0:
            if i in factors:
                factors[i] += 1
            else:
                factors[i] = 1

            while s % i == 0:
                s //= i

    if s > 1 and s in factors:
        factors[s] += 1
    elif s > 1 and s not in factors:
        factors[s] = 1

# print(factors)

if len(factors.values()) == 0:
    ans = 1
else:
    ans = max(factors.values())

print(ans)

import functools
import sys
input = lambda :sys.stdin.readline()
@functools.lru_cache(maxsize=10000)

def factor(n):
    res = []
    d = 2

    while d*d <= n:
        if n % d == 0:
            res.append(d)
            n //= d
        else:
            d += 1

    if n > 1:
        res.append(n)

    # print("res" ,res)

    return set(res)

def Main(n):
    A = list(map(int, input().split()))[:n]
    # print(A)
    dic = dict()
    # print(factor(1))

    for p in A:
        # print(factor(p))
        for d in factor(p):
            if d in dic.keys():
                dic[d] += 1
            else:
                dic[d] = 1

            # print(dic)

    if dic:
        print(max(dic.values()))
    else:
        print(1)



def __starting_point():
    n = int(input())
    Main(n)
__starting_point()

the_len = int(input())
s2 = input()
import math
nums = s2.split(' ')

groups = [0] * 100001
max = 1

for n in nums:
    groups[int(n)] += 1

for i in range(2,100001):
    res = 0
    for j in range(i,100001,i):
        res += groups[j]
    if res > max :
        max = res

print (max)

the_len = int(input())
s2 = input()
import math
nums = s2.split(' ')

groups = [0] * 100001
max = 1

for n in nums:
    groups[int(n)] += 1

for i in range(2,100001):
    res = 0
    for j in range(i,100001,i):
        res += groups[j]
    if res > max :
        max = res

print (max)

def function1(n,s):
    if n==1:
        return 1
    pokemonj=0
    pokecage=[0 for i in range(100001)]
    for i in range(n):
        pokecage[s[i]]+=1
    maxyincage=min(pokecage[1],1)
    a = [i for i in range(100001)]
    a[1] = 0

    i = 2

    while i <= 100000:
        if a[i] != 0:

            pokemonj=0
            for j in range(i, 100001, i):
                a[j] = 0
                pokemonj+=pokecage[j]
            if pokemonj>maxyincage:
                maxyincage=pokemonj

        i += 1

    return(maxyincage)



def main():
    n=int(input())
    s=list(map(int,input().split()))
    print(function1(n,s))
def __starting_point():
    main()



__starting_point()

def function1(n,s):
    if n==1:
        return 1
    sn=max(s)
    pokemonj=0
    pokecage=[0 for i in range(sn+1)]
    for i in range(n):
        pokecage[s[i]]+=1
    maxyincage=min(pokecage[1],1)
    a = [i for i in range(sn+1)]
    a[1] = 0

    i = 2

    while i <= sn:
        if a[i] != 0:

            pokemonj=pokecage[i]
            for j in range(i*2, sn+1, i):
                a[j] = 0
                pokemonj+=pokecage[j]
            if pokemonj>maxyincage:
                maxyincage=pokemonj

        i += 1

    return(maxyincage)



def main():
    n=int(input())
    s=list(map(int,input().split()))
    print(function1(n,s))
def __starting_point():
    main()



__starting_point()