Fox Ciel is playing a game with numbers now. 

Ciel has *n* positive integers: *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*n*</sub>. She can do the following operation as many times as needed: select two different indexes *i* and *j* such that *x*<sub class="lower-index">*i*</sub> &gt; *x*<sub class="lower-index">*j*</sub> hold, and then apply assignment *x*<sub class="lower-index">*i*</sub> = *x*<sub class="lower-index">*i*</sub> - *x*<sub class="lower-index">*j*</sub>. The goal is to make the sum of all numbers as small as possible.

Please help Ciel to find this minimal sum.
The first line contains an integer *n* (2 ≤ *n* ≤ 100). Then the second line contains *n* integers: *x*<sub class="lower-index">1</sub>, *x*<sub class="lower-index">2</sub>, ..., *x*<sub class="lower-index">*n*</sub> (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ 100).
n = int(input())
number = [int(i) for i in input().split()]
odd = [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]
lenth = len(odd)

result = [100] * lenth

for i in range(n):
	cur = number[i]
	tem = [0] * lenth
	for j in range(lenth):
		while cur % odd[j] == 0:
			cur = cur/odd[j]
			tem[j] += 1
		if cur % odd[j] != 0:
			if tem[j] < result[j]:
				result[j] = tem[j]

sumpre = 1
for i in range(lenth):
	if result[i] != 0 and result[i] != 100:
		temp = result[i]
		while temp > 0:
			sumpre *= odd[i] 
			temp -= 1

sumnum = n * sumpre
print(sumnum)