import math s = int(raw_input()) a = map(int, raw_input().split()) tot = 0 for val in a: # find factors fac = [] while val % 2 == 0: fac.append(2) val /= 2 for i in xrange(3, int(math.sqrt(val))+1, 2): while val % i == 0: fac.append(i) val /= i if val > 2: fac.append(val) # compute score i = 0 ps = 1 tot += ps while i < len(fac): ps *= fac[len(fac)-1-i] tot += ps i += 1 print tot