n=int(input())
s=input().split(' ')
for i in range(n):
    s[i]=int(s[i])
n1=1
a=[]
r=0
for i in s:
    n1=n1*i
for i in range(1,n1+1):
    if (n1/i) % 1 == 0:
        a.append(i)
    else:
        pass
for i in a:
    r+=i
print(r)