def p(b): for i in range(2,int(b**(1/2))+1): if b%i == 0: return int(b/i) return 1 n = int(input()) s = 0 a = list(map(int,input().split(" "))) for i in a: w = i while p(i) != 1: x = p(i) s += x i = x if w > 1: s += 1 + w else: s += 1 print(s)