a=int(input())
b=map(int,input().split(" "))
b=list(b)
u=b[1]*b[0]
p=[]
for i in range(2,a):
    u=u*b[i]
for i in range(1,u,1):
    if u%i==0:
        p.append(i)
print(sum(p))
    
    
    
    

        
        
                
        
