import math n = int(input()) a = map(int, input().split()) ans = 0 for x in a: ans += x while not x % 2: x //= 2 ans += x i = 3 while i <= int(math.sqrt(x)): while not x % i: x //= i ans += x i += 2 if x > 2: ans += 1 print(ans)