m=int(input())
l=[]
l=[int(i) for i in input().split(' ')]
h=1
for i in range(m):
    h*=l[i]
a=[]
for i in range(1,h):
    if h%i==0:
        if i in a:
            pass
        else:
            a.append(i)
            a.append(h%i)
print(sum(a))