n = int(input())
b = 1
c = 0
d = 0
for i in range(n):
    a = int(input())
    b = b*a
for i in range(b):
    c = c+1
    if b % c == 0:
        d = d+c
    if c == b:
        break
print(d)
    
   
    
