n = int(input())
a = input().split(" ")

max = a[0]
for i in range(1,n) :
    if max < a[i] :
        max = a[i]

f = 0
for j in range(1,int(max)) :
    for d in range(0,n) :
        f[j] += j//a[d]

max1 = 0
for i in range(1,int(max)):
    if max1 < f[i] :
        max1 = f[i]

print(max1)